From 9c2a4d40a97be73549fe03b1b69687f775102dd5 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Fri, 7 May 2004 18:55:00 +0000 Subject: Provide code to calculate the characteristics. darcs-hash:20040507185547-07bb3-ee275ba5fa0a403c578a0ff525e77f65bee4969e.gz --- CarpetExtra/WaveToyFO/configuration.ccl | 4 +- CarpetExtra/WaveToyFO/interface.ccl | 31 ++++- CarpetExtra/WaveToyFO/src/calc_inv4.F90 | 10 ++ CarpetExtra/WaveToyFO/src/characteristics.c | 197 ++++++++++++++++++++++++++++ CarpetExtra/WaveToyFO/src/make.code.defn | 4 +- 5 files changed, 241 insertions(+), 5 deletions(-) create mode 100644 CarpetExtra/WaveToyFO/src/calc_inv4.F90 create mode 100644 CarpetExtra/WaveToyFO/src/characteristics.c (limited to 'CarpetExtra/WaveToyFO') diff --git a/CarpetExtra/WaveToyFO/configuration.ccl b/CarpetExtra/WaveToyFO/configuration.ccl index 134da61b7..0fd6cd4be 100644 --- a/CarpetExtra/WaveToyFO/configuration.ccl +++ b/CarpetExtra/WaveToyFO/configuration.ccl @@ -1,4 +1,4 @@ # Configuration definition for thorn Carpet/WaveToyFO -# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/configuration.ccl,v 1.2 2004/04/18 14:10:29 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/configuration.ccl,v 1.3 2004/05/07 20:55:47 schnetter Exp $ -REQUIRES CartGrid3D +REQUIRES CartGrid3D TGRtensor diff --git a/CarpetExtra/WaveToyFO/interface.ccl b/CarpetExtra/WaveToyFO/interface.ccl index 893aec679..c855343ae 100644 --- a/CarpetExtra/WaveToyFO/interface.ccl +++ b/CarpetExtra/WaveToyFO/interface.ccl @@ -1,5 +1,5 @@ # Interface definition for thorn WaveToyFO -# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/interface.ccl,v 1.1 2003/06/18 18:24:30 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/interface.ccl,v 1.2 2004/05/07 20:55:47 schnetter Exp $ IMPLEMENTS: WaveToyFO @@ -22,6 +22,35 @@ USES FUNCTION MoLRegisterEvolvedGroup +CCTK_INT FUNCTION \ + MultiPatch_Prim2Char \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_INT ARRAY IN normal, \ + CCTK_INT ARRAY IN lbnd, \ + CCTK_INT ARRAY IN lsh, \ + CCTK_INT IN rhs_flag, \ + CCTK_INT IN num_modes, \ + CCTK_POINTER ARRAY IN modes, \ + CCTK_REAL ARRAY OUT speeds) +PROVIDES FUNCTION MultiPatch_Prim2Char \ + WITH WaveToyFO_MultiPatch_Prim2Char \ + LANGUAGE C + +CCTK_INT FUNCTION \ + MultiPatch_Char2Prim \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_INT ARRAY IN normal, \ + CCTK_INT ARRAY IN lbnd, \ + CCTK_INT ARRAY IN lsh, \ + CCTK_INT IN rhs_flag, \ + CCTK_INT IN num_modes, \ + CCTK_POINTER_TO_CONST ARRAY IN modes) +PROVIDES FUNCTION MultiPatch_Char2Prim \ + WITH WaveToyFO_MultiPatch_Char2Prim \ + LANGUAGE C + + + PUBLIC: CCTK_REAL scalarevolve TYPE=gf TIMELEVELS=3 diff --git a/CarpetExtra/WaveToyFO/src/calc_inv4.F90 b/CarpetExtra/WaveToyFO/src/calc_inv4.F90 new file mode 100644 index 000000000..9393f2232 --- /dev/null +++ b/CarpetExtra/WaveToyFO/src/calc_inv4.F90 @@ -0,0 +1,10 @@ +! $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/src/Attic/calc_inv4.F90,v 1.1 2004/05/07 20:55:47 schnetter Exp $ + +#include "cctk.h" + +subroutine WaveToyFO_calc_inv4 (a, b) + use matinv + implicit none + CCTK_REAL a(4,4), b(4,4) + call calc_inv4 (a, b) +end subroutine WaveToyFO_calc_inv4 diff --git a/CarpetExtra/WaveToyFO/src/characteristics.c b/CarpetExtra/WaveToyFO/src/characteristics.c new file mode 100644 index 000000000..6626aa999 --- /dev/null +++ b/CarpetExtra/WaveToyFO/src/characteristics.c @@ -0,0 +1,197 @@ +/* $Header: /home/eschnett/C/carpet/Carpet/CarpetExtra/WaveToyFO/src/Attic/characteristics.c,v 1.1 2004/05/07 20:55:47 schnetter Exp $ */ + +#include + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + + + +void CCTK_FCALL +CCTK_FNAME (WaveToyFO_calc_inv4) (CCTK_REAL xform[4][4], + CCTK_REAL xform1[4][4]); + + + +CCTK_INT +WaveToyFO_MultiPatch_Prim2Char (CCTK_POINTER_TO_CONST const cctkGH_, + CCTK_INT const normal[], + CCTK_INT const lbnd[], + CCTK_INT const lsh[], + CCTK_INT const rhs_flag, + CCTK_INT const num_modes, + CCTK_POINTER const modes[], + CCTK_REAL speeds[]) +{ + cGH const * restrict const cctkGH = cctkGH_; + DECLARE_CCTK_ARGUMENTS; + + CCTK_INT tangent[2][3]; + + CCTK_REAL const * restrict prims[4]; + CCTK_REAL * restrict chars[4]; + + CCTK_REAL xform[4][4]; + + int n; /* mode */ + int i, j, k; + int a, b; + int d; + + assert (cctk_dim == 3); + assert (num_modes == 4); + for (d=0; d<3; ++d) { + assert (lsh[d] >= 0); + } + for (n=0; n= 0); + } + for (n=0; n