File size: 12,187 Bytes
0950351
 
 
 
 
10a2580
0950351
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "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 <math.h>\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<cctk_lsh[2]; k++)\n    {\n      for(j=0; j<cctk_lsh[1]; j++)\n      {\n        for(i=0; i<cctk_lsh[0]; i++)\n        {\n          index = CCTK_GFINDEX3D(cctkGH,i,j,k);\n\n          X = x[index] - centrex;\n          Y = y[index] - centrey;\n          Z = z[index] - centrez;\n\n          R = sqrt(X*X + Y*Y + Z*Z);\n\n          phi[index] = amplitude*exp( - sqr( (R - radius) / sigma ) );\n          phit[index] = 0.0;\n          if (R > 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<cctk_lsh[2]; k++)\n    {\n      for(j=0; j<cctk_lsh[1]; j++)\n      {\n        for(i=0; i<cctk_lsh[0]; i++)\n        {\n          index = CCTK_GFINDEX3D(cctkGH,i,j,k);\n\n          X = x[index] - offsetx;\n          Y = y[index] - offsety;\n          Z = z[index] - offsetz;\n\n          arg = 2*pi * (kx*X + ky*Y + kz*Z - omega*T);\n\n          phi[index]  = slopet*T + slopex*X + slopey*Y + slopez*Z\n                               +        amplitude *         cos (arg);\n          phit[index] = slopet + 2*pi * amplitude * omega * sin (arg);\n          phix[index] = slopex - 2*pi * amplitude * kx    * sin (arg);\n          phiy[index] = slopey - 2*pi * amplitude * ky    * sin (arg);\n          phiz[index] = slopez - 2*pi * amplitude * kz    * sin (arg);\n        }\n      }\n    }\n  }\n  else \n  {\n    CCTK_WARN(0, \"Value of parameter \\\"initial_data\\\" not recognized.\");\n  }\n\n}\n\n",
    "CheckParameters.c": "/*\n   @file      CheckParameters.c\n   @date      \n   @author    Gabrielle Allen\n   @desc \n              Check parameters for the wave equation initial data\n   @enddesc \n   @version $Header$\n @@*/\n\n#include \"cctk.h\" \n#include \"cctk_Parameters.h\"\n#include \"cctk_Arguments.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusExamples_IDWaveMoL_CheckParameters_c)\n\nvoid IDWaveMoL_CheckParameters(CCTK_ARGUMENTS);\n\n /*@@\n   @routine    IDScalarWaveC_CheckParameters\n   @date       \n   @author     Gabrielle Allen\n   @desc \n               Check parameters for the wave equation initial data\n   @enddesc \n   @calls      \n   @calledby   \n   @history \n   @hdate Mon Oct 11 11:49:21 1999 @hauthor Tom Goodale\n   @hdesc Converted to C++ \n   @hdate Thu Feb 17 09:20:41 2000 @hauthor Tom Goodale\n   @hdesc Converted to C\n   @endhistory \n\n@@*/\n\nvoid IDWaveMoL_CheckParameters(CCTK_ARGUMENTS)\n{\n  DECLARE_CCTK_ARGUMENTS_IDWaveMoL_CheckParameters;\n  DECLARE_CCTK_PARAMETERS;\n\n}\n\n"
  },
  "test": {},
  "doc": {
    "documentation.tex": "% *======================================================================*\n%  Cactus Thorn template for ThornGuide documentation\n%  Author: Ian Kelley\n%  Date: Sun Jun 02, 2002\n%  $Header$                                                             \n%\n%  Thorn documentation in the latex file doc/documentation.tex \n%  will be included in ThornGuides built with the Cactus make system.\n%  The scripts employed by the make system automatically include \n%  pages about variables, parameters and scheduling parsed from the \n%  relevent thorn CCL files.\n%  \n%  This template contains guidelines which help to assure that your     \n%  documentation will be correctly added to ThornGuides. More \n%  information is available in the Cactus UsersGuide.\n%                                                    \n%  Guidelines:\n%   - Do not change anything before the line\n%       % START CACTUS THORNGUIDE\",\n%     except for filling in the title, author, date etc. fields.\n%        - Each of these fields should only be on ONE line.\n%        - Author names should be sparated with a \\\\ or a comma\n%   - You can define your own macros, but they must appear after\n%     the START CACTUS THORNGUIDE line, and must not redefine standard \n%     latex commands.\n%   - To avoid name clashes with other thorns, 'labels', 'citations', \n%     'references', and 'image' names should conform to the following \n%     convention:          \n%       ARRANGEMENT_THORN_LABEL\n%     For example, an image wave.eps in the arrangement CactusWave and \n%     thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps\n%   - Graphics should only be included using the graphix package. \n%     More specifically, with the \"includegraphics\" command. Do\n%     not specify any graphic file extensions in your .tex file. This \n%     will allow us (later) to create a PDF version of the ThornGuide\n%     via pdflatex. |\n%   - References should be included with the latex \"bibitem\" command. \n%   - Use \\begin{abstract}...\\end{abstract} instead of \\abstract{...}\n%   - Do not use \\appendix, instead include any appendices you need as \n%     standard sections. \n%   - For the benefit of our Perl scripts, and for future extensions, \n%     please use simple latex.     \n%\n% *======================================================================* \n% \n% Example of including a graphic image:\n%    \\begin{figure}[ht]\n%       \\begin{center}\n%          \\includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}\n%       \\end{center}\n%       \\caption{Illustration of this and that}\n%       \\label{MyArrangement_MyThorn_MyLabel}\n%    \\end{figure}\n%\n% Example of using a label:\n%   \\label{MyArrangement_MyThorn_MyLabel}\n%\n% Example of a citation:\n%    \\cite{MyArrangement_MyThorn_Author99}\n%\n% Example of including a reference\n%   \\bibitem{MyArrangement_MyThorn_Author99}\n%   {J. Author, {\\em The Title of the Book, Journal, or periodical}, 1 (1999), \n%   1--16. {\\tt http://www.nowhere.com/}}\n%\n% *======================================================================* \n\n% If you are using CVS use this line to give version information\n% $Header$\n\n\\documentclass{article}\n\n% Use the Cactus ThornGuide style file\n% (Automatically used from Cactus distribution, if you have a \n%  thorn without the Cactus Flesh download this from the Cactus\n%  homepage at www.cactuscode.org)\n\\usepackage{../../../../doc/latex/cactus}\n\n\\begin{document}\n\n% The author of the documentation\n\\author{Ian Hawke} \n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{IDWaveMoL}\n\n% the date your document was last changed, if your document is in CVS, \n% please use:\n\\date{$ $Date$ $}\n\n\\maketitle\n\n% Do not delete next line\n% START CACTUS THORNGUIDE\n\n% Add all definitions used in this documentation here \n%   \\def\\mydef etc\n\n% Add an abstract for this thorn's documentation\n\\begin{abstract}\n  Initial data for the CactusExamples/WaveMoL thorn.\n\\end{abstract}\n\n% The following sections are suggestive only.\n% Remove them or add your own.\n\n% \\section{Introduction}\n\n% \\section{Physical System}\n\n% \\section{Numerical Implementation}\n\n\\section{Using This Thorn}\n\nIDWaveMoL provides simple initial data to the WaveMoL thorn. Currently\nonly a time symmetric gaussian pulse is provided.\n\n\n% \\subsection{Obtaining This Thorn}\n\n% \\subsection{Basic Usage}\n\n% \\subsection{Special Behaviour}\n\n% \\subsection{Interaction With Other Thorns}\n\n% \\subsection{Examples}\n\n% \\subsection{Support and Feedback}\n\n% \\section{History}\n\n% \\subsection{Thorn Source Code}\n\n% \\subsection{Thorn Documentation}\n\n% \\subsection{Acknowledgements}\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n"
  }
}