{ "thorn_name": "CactusExamples/IDWaveMoL", "url": "https://bitbucket.org/cactuscode/cactusexamples.git", "configuration": "", "interface": "# Interface definition for thorn IDScalarWaveMoLC\n# $Header$\n\nimplements: idwavemol\ninherits: wavemol grid\n\n", "param": "# Parameter definitions for thorn IDScalarWaveMoLC\n# $Header$\n\nrestricted:\n\nKEYWORD initial_data \"Type of initial data\"\n{\n \"gaussian\" :: \"Gaussian wave\"\n \"plane\" :: \"plane wave\"\n} \"gaussian\"\n\nprivate:\n\nREAL amplitude \"The amplitude of the waves\"\n{\n *:* :: \"No restriction\"\n} 1.0\n\n\n\nREAL radius \"The radius of the gaussian wave\"\n{\n 0:* :: \"Positive\"\n} 0.0\n\nREAL sigma \"The sigma for the gaussian wave\"\n{\n 0:* :: \"Positive\"\n} 0.1\n\nREAL centrex \"The centre of the gaussian wave, x-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL centrey \"The centre of the gaussian wave, y-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL centrez \"The centre of the gaussian wave, z-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\n\n\nREAL kx \"Wave number in the x-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL ky \"Wave number in the y-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL kz \"Wave number in the z-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL offsett \"Wave offset in the time-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL offsetx \"Wave offset in the x-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL offsety \"Wave offset in the y-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL offsetz \"Wave offset in the z-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL slopet \"Wave slope in the time-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL slopex \"Wave slope in the x-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL slopey \"Wave slope in the y-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n\nREAL slopez \"Wave slope in the z-direction\"\n{\n *:* :: \"Anything\"\n} 0.0\n", "schedule": "# Schedule definitions for thorn IDScalarWaveMoLC\n# $Header$\n\nschedule IDWaveMoL_CheckParameters at CCTK_PARAMCHECK\n{\n LANG: C\n} \"Check parameters\"\n\nschedule IDWaveMoL_InitialData at CCTK_INITIAL\n{\n STORAGE: wavemol::scalarevolvemol_scalar[2]\n STORAGE: wavemol::scalarevolvemol_vector[2]\n LANG: C\n READS: grid::x, grid::y, grid::z\n WRITES: wavemol::scalarevolvemol_scalar(everywhere),\n wavemol::scalarevolvemol_vector(everywhere)\n} \"Initial data for 3D wave equation\"\n\n", "src": { "make.code.defn": "# Main make.code.defn file for thorn IDScalarWaveMoLC\n# $Header$\n\n# Source files in this directory\nSRCS = InitialData.c CheckParameters.c\n\n# Subdirectories containing source files\nSUBDIRS = \n\n", "InitialData.c": " /*@@\n @file InitialData.c\n @date \n @author Werner Benger \n @desc \n Initial data for the 3D Wave Equation\n\t Derived from Tom Goodale\n @enddesc \n @version $Header$\n @@*/\n\n#include \n\n#include \"cctk.h\" \n#include \"cctk_Parameters.h\"\n#include \"cctk_Arguments.h\"\n\n/*\n#ifndef DEBUG_MOL\n#define DEBUG_MOL\n#endif\n*/\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusExamples_IDWaveMoL_InitialData_c)\n\nstatic inline CCTK_REAL sqr(const CCTK_REAL val)\n{\n return val*val;\n}\n\nvoid IDWaveMoL_InitialData(CCTK_ARGUMENTS);\n\n\n /*@@\n @routine IDWaveMoL_InitialData\n @date \n @author Tom Goodale\n @desc \n Set up initial data for the wave equation\n @enddesc \n @calls \n @calledby \n @history \n @hdate Mon Oct 11 11:48:03 1999 @hauthor Werner Benger\n @hdesc Converted to C++\n @hdate Mon Oct 11 11:48:20 1999 @hauthor Tom Goodale\n @hdesc Added the rest of the initial data.\n @hdate Thu Feb 17 09:22:01 2000 @hauthor Tom Goodale\n @hdesc Converted to C\n @endhistory \n\n@@*/\n\nvoid IDWaveMoL_InitialData(CCTK_ARGUMENTS)\n{\n DECLARE_CCTK_ARGUMENTS_IDWaveMoL_InitialData\n DECLARE_CCTK_PARAMETERS\n \n int i,j,k;\n\n CCTK_REAL omega;\n CCTK_REAL arg;\n int index;\n CCTK_REAL T, X, Y, Z, R;\n const CCTK_REAL pi = acos(-1.0);\n\n#ifdef DEBUG_MOL\n printf(\"Initial data says sigma = %g, radius = %g\\n\", sigma, radius);\n#endif\n\n if (CCTK_Equals(initial_data, \"gaussian\"))\n {\n for(k=0; k 1.e-10) {\n phix[index] = -2.0*(R-radius)/sqr(sigma)*X/R*phi[index];\n phiy[index] = -2.0*(R-radius)/sqr(sigma)*Y/R*phi[index];\n phiz[index] = -2.0*(R-radius)/sqr(sigma)*Z/R*phi[index];\n } \n else {\n phix[index] = 0.0;\n phiy[index] = 0.0;\n phiz[index] = 0.0;\n } \n }\n }\n }\n }\n else if (CCTK_Equals(initial_data, \"plane\"))\n {\n omega = sqrt(sqr(kx) + sqr(ky) + sqr(kz));\n T = cctk_time - offsett;\n\n for(k=0; k