diff options
author | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-05-21 09:12:14 +0000 |
---|---|---|
committer | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-05-21 09:12:14 +0000 |
commit | f3a2829b5b32b6fad8383ac16c16ac6c2f58b696 (patch) | |
tree | 19a58318d2bcb7f95ecf044e5713453d9bff0bea /src/IndexArrays.c | |
parent | 7e9dff2f70bd9950b27092e816f9a3cc14ff3582 (diff) |
Add support for evolving complex GFs and (real and complex) GAs.
Only works with ICN or RK2 for now - in fact this commit may break the generic RK methods temporarily.
Note the documentation isn't quite right - there's no longer a seperate function for each different type...
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@12 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/IndexArrays.c')
-rw-r--r-- | src/IndexArrays.c | 178 |
1 files changed, 176 insertions, 2 deletions
diff --git a/src/IndexArrays.c b/src/IndexArrays.c index 7050e2d..01820eb 100644 --- a/src/IndexArrays.c +++ b/src/IndexArrays.c @@ -35,7 +35,7 @@ CCTK_FILEVERSION(AlphaThorns_MoL_IndexArrays_c); void MoL_SetupIndexArrays(CCTK_ARGUMENTS); -void MoL_FreeIndexArrays(); +void MoL_FreeIndexArrays(void); /******************************************************************** ********************* Other Routine Prototypes ********************* @@ -114,6 +114,108 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS) CCTK_WARN(0,"Failed to allocate the save and restore variable index array"); } + + if (EvolvedComplexVariableIndex) + { + return; + } + + EvolvedComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexEvolved_Vars * + sizeof(CCTK_INT)); + if (!EvolvedComplexVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the evolved complex variable index array"); + } + + RHSComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexEvolved_Vars * + sizeof(CCTK_INT)); + if (!RHSComplexVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the RHS complex variable index array"); + } + + ConstrainedComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexConstrained_Vars * + sizeof(CCTK_INT)); + if (!ConstrainedComplexVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the constrained complex variable index array"); + } + + SandRComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexSaveAndRestore_Vars * + sizeof(CCTK_INT)); + if (!SandRComplexVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the save and restore complex variable index array"); + } + + + if (EvolvedArrayVariableIndex) + { + return; + } + + EvolvedArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayEvolved_Vars * + sizeof(CCTK_INT)); + if (!EvolvedArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the evolved array variable index array"); + } + + RHSArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayEvolved_Vars * + sizeof(CCTK_INT)); + if (!RHSArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the RHS array variable index array"); + } + + ConstrainedArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayConstrained_Vars * + sizeof(CCTK_INT)); + if (!ConstrainedArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the constrained array variable index array"); + } + + SandRArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArraySaveAndRestore_Vars * + sizeof(CCTK_INT)); + if (!SandRArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the save and restore array variable index array"); + } + + + if (EvolvedComplexArrayVariableIndex) + { + return; + } + + EvolvedComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayEvolved_Vars * + sizeof(CCTK_INT)); + if (!EvolvedComplexArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the evolved complex array variable index array"); + } + + RHSComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayEvolved_Vars * + sizeof(CCTK_INT)); + if (!RHSComplexArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the RHS complex array variable index array"); + } + + ConstrainedComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayConstrained_Vars * + sizeof(CCTK_INT)); + if (!ConstrainedComplexArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the constrained complex array variable index array"); + } + + SandRComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArraySaveAndRestore_Vars * + sizeof(CCTK_INT)); + if (!SandRComplexArrayVariableIndex) + { + CCTK_WARN(0,"Failed to allocate the save and restore complex array variable index array"); + } + infoline = (char *)malloc(100*sizeof(char)); if (!infoline) { @@ -175,7 +277,7 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS) @@*/ -void MoL_FreeIndexArrays() +void MoL_FreeIndexArrays(void) { if (EvolvedVariableIndex) @@ -201,6 +303,78 @@ void MoL_FreeIndexArrays() free(SandRVariableIndex); SandRVariableIndex = NULL; } + + if (EvolvedComplexVariableIndex) + { + free(EvolvedComplexVariableIndex); + EvolvedComplexVariableIndex = NULL; + } + + if (RHSComplexVariableIndex) + { + free(RHSComplexVariableIndex); + RHSComplexVariableIndex = NULL; + } + + if (ConstrainedComplexVariableIndex) + { + free(ConstrainedComplexVariableIndex); + ConstrainedComplexVariableIndex = NULL; + } + + if (SandRComplexVariableIndex) + { + free(SandRComplexVariableIndex); + SandRComplexVariableIndex = NULL; + } + + if (EvolvedArrayVariableIndex) + { + free(EvolvedArrayVariableIndex); + EvolvedArrayVariableIndex = NULL; + } + + if (RHSArrayVariableIndex) + { + free(RHSArrayVariableIndex); + RHSArrayVariableIndex = NULL; + } + + if (ConstrainedArrayVariableIndex) + { + free(ConstrainedArrayVariableIndex); + ConstrainedArrayVariableIndex = NULL; + } + + if (SandRArrayVariableIndex) + { + free(SandRArrayVariableIndex); + SandRArrayVariableIndex = NULL; + } + + if (EvolvedComplexArrayVariableIndex) + { + free(EvolvedComplexArrayVariableIndex); + EvolvedComplexArrayVariableIndex = NULL; + } + + if (RHSComplexArrayVariableIndex) + { + free(RHSComplexArrayVariableIndex); + RHSComplexArrayVariableIndex = NULL; + } + + if (ConstrainedComplexArrayVariableIndex) + { + free(ConstrainedComplexArrayVariableIndex); + ConstrainedComplexArrayVariableIndex = NULL; + } + + if (SandRComplexArrayVariableIndex) + { + free(SandRComplexArrayVariableIndex); + SandRComplexArrayVariableIndex = NULL; + } return; |