aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@edbb7e70-9571-45d5-a481-0a560a9b4751>2004-05-17 12:28:56 +0000
committergoodale <goodale@edbb7e70-9571-45d5-a481-0a560a9b4751>2004-05-17 12:28:56 +0000
commit6029755335ee4e73061d767790f44f00718adf57 (patch)
tree19af64fb5bafa4448c1a00d4f7e16c470b9f6330
parent23e4bb963596c8d0f35b0b8c0cac5a885bf1b2c4 (diff)
Untabified. Please try to adhere to the Cactus coding guidelines when
modifying or adding files. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/CoordGauge/trunk@54 edbb7e70-9571-45d5-a481-0a560a9b4751
-rw-r--r--src/Slicing.c170
1 files changed, 85 insertions, 85 deletions
diff --git a/src/Slicing.c b/src/Slicing.c
index 75b60d7..b18202c 100644
--- a/src/Slicing.c
+++ b/src/Slicing.c
@@ -96,7 +96,7 @@ int Einstein_RegisterSlicing(const char *slice_name)
new_slicing->name = (char *)slice_name;
/* Function pointer , evaluates if to perform this slicings, allowing
- for iteration checks, gridfunction behavior, etc. Will be set by
+ for iteration checks, gridfunction behavior, etc. Will be set by
Einstein_RegisterTimeToSlice */
new_slicing->timetoslice = NULL;
@@ -118,8 +118,8 @@ int Einstein_RegisterSlicing(const char *slice_name)
{
/* Extension handle already exists */
CCTK_VWarn(0,__LINE__,__FILE__,CCTK_THORNSTRING,
- "New handle %s (%d) already in use",
- slice_name,handle);
+ "New handle %s (%d) already in use",
+ slice_name,handle);
handle = -1;
}
@@ -190,8 +190,8 @@ int Einstein_RegisterTimeToSlice(int handle, int (*func)(cGH *))
{
/* handle didn't return the data pointer */
CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING,
- "Could not obtain slicing structure for handle %d",
- handle);
+ "Could not obtain slicing structure for handle %d",
+ handle);
return_code = 0;
}
@@ -255,46 +255,46 @@ void Einstein_ActivateSlicing(cGH *GH)
{
if (CCTK_Equals(lapse_evolution_method,"static"))
- {
+ {
handle2=Einstein_RegisterSlicing("static");
if (handle2<0)
- {
- CCTK_WARN(1,"Cannot register static slicing");
- }
- }
+ {
+ CCTK_WARN(1,"Cannot register static slicing");
+ }
+ }
else if (CCTK_Equals(lapse_evolution_method,"geodesic"))
- {
+ {
handle2=Einstein_RegisterSlicing("geodesic");
if (handle2<0)
- {
- CCTK_WARN(1,"Cannot register geodesic slicing");
- }
- }
- else
- {
- CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING,
- "Cannot get handle for slicing %s",lapse_evolution_method);
- }
- return;
+ {
+ CCTK_WARN(1,"Cannot register geodesic slicing");
+ }
+ }
+ else
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING,
+ "Cannot get handle for slicing %s",lapse_evolution_method);
+ }
+ return;
}
slic = Util_GetHandledData(Eslicings,handle);
if (!slic)
{
- CCTK_WARN(0,"Cannot access handle structure!");
+ CCTK_WARN(0,"Cannot access handle structure!");
}
slic->param_active = 1;
/*Some error checking: */
if (slic->timetoslice!=NULL)
{
- err = (char*)malloc(256*sizeof(char));
- sprintf(err,"%s%s%s%s",
- "ERROR: You have specified a unique slicing (",slic->name,
- ") AND a condition-function is registered for that slicing.\n ",
- "Impossible, what should I do inbetween ? Rather set slicing -> mixed");
- CCTK_WARN(0,err);
- if (err) free(err);
+ err = (char*)malloc(256*sizeof(char));
+ sprintf(err,"%s%s%s%s",
+ "ERROR: You have specified a unique slicing (",slic->name,
+ ") AND a condition-function is registered for that slicing.\n ",
+ "Impossible, what should I do inbetween ? Rather set slicing -> mixed");
+ CCTK_WARN(0,err);
+ if (err) free(err);
}
}
/* We have mixed slicing: we check the mixed_slicing parameter */
@@ -320,28 +320,28 @@ void Einstein_ActivateSlicing(cGH *GH)
{
if (CCTK_Equals(item,"static"))
{
- printf("Registering Static\n");
- handle2=Einstein_RegisterSlicing("static");
- if (handle2<0)
- {
- CCTK_WARN(1,"Cannot register static slicing");
- }
+ printf("Registering Static\n");
+ handle2=Einstein_RegisterSlicing("static");
+ if (handle2<0)
+ {
+ CCTK_WARN(1,"Cannot register static slicing");
+ }
}
else if (CCTK_Equals(item,"geodesic"))
{
- handle2=Einstein_RegisterSlicing("geodesic");
- if (handle2<0)
- {
- CCTK_WARN(1,"Cannot register geodesic slicing");
- }
+ handle2=Einstein_RegisterSlicing("geodesic");
+ if (handle2<0)
+ {
+ CCTK_WARN(1,"Cannot register geodesic slicing");
+ }
}
slic = Util_GetHandledData(Eslicings,Util_GetHandle(Eslicings,item,NULL));
if (!slic)
{
- CCTK_VWarn(0,__LINE__,__FILE__,CCTK_THORNSTRING,
- "No registered slicing for <%s>",item);
+ CCTK_VWarn(0,__LINE__,__FILE__,CCTK_THORNSTRING,
+ "No registered slicing for <%s>",item);
}
slic->param_active = priority;
@@ -377,12 +377,12 @@ void Einstein_ActivateSlicing(cGH *GH)
slic = Util_GetHandledData(Eslicings,h);
if (!slic)
{
- CCTK_WARN(0,"Cannot get slicing for handle.");
+ CCTK_WARN(0,"Cannot get slicing for handle.");
}
printf(" Einstein_ActivateSlicing: >>%s<< priority: %d %s \n",
- slic->name,
- slic->param_active,
- (char*)((slic->timetoslice)?"FUNC":"nofunc "));
+ slic->name,
+ slic->param_active,
+ (char*)((slic->timetoslice)?"FUNC":"nofunc "));
}
}
#endif
@@ -417,8 +417,8 @@ int Einstein_GetSlicingHandle(const char *name)
if (handle<0)
{
CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING,
- "Einstein_GetSlicingHandle: cannot get handle for slicing %s",
- name);
+ "Einstein_GetSlicingHandle: cannot get handle for slicing %s",
+ name);
}
return(handle);
}
@@ -444,7 +444,7 @@ int CCTK_FCALL CCTK_FNAME(Einstein_GetSlicingHandle)(ONE_FORTSTRING_ARG)
1..n priority of the slicing, in the order it is specified in the par file,
e.g. "1+log maximal static"
- This is only called from CCTK_PRESTEP
+ This is only called from CCTK_PRESTEP
@calls
@calledby
@history
@@ -500,48 +500,48 @@ void Einstein_SetNextSlicing(cGH *GH)
{
for (h=0;h<num_slicings;h++)
{
-#ifdef ESLIC_DEBUG
+#ifdef ESLIC_DEBUG
printf("HANDLE LOOP: %d of %d\n",h,num_slicings);
-#endif
+#endif
slic = (struct Einstein_slicing *)Util_GetHandledData(Eslicings,h);
if (!slic)
{
- CCTK_WARN(0,"Slicing registry out of sync! No slicing found!");
+ CCTK_WARN(0,"Slicing registry out of sync! No slicing found!");
}
else
{
- /* we have two competing flags: the priority and the
- timetoslice function. We pick two handles for
- 1) highest priority (lowest param_active number)
- for timetoslice = yes (1)
- 2) highest priority (lowest param_active number)
- for timetoslice = don't care (0)
- set the active_slicing_handle to one of the two handles
- in this order
- */
- if ((slic->param_active>0))
- {
- doicare = 0;
- if (slic->timetoslice!=NULL)
- {
- doicare = slic->timetoslice(GH);
- }
- if ((doicare== SLICING_YES) && (slic->param_active<h_yes))
- {
- h_yes = h;
- }
- if ((doicare== SLICING_DONTCARE) && (slic->param_active<h_egal))
- {
- h_egal= h;
- }
- if ((doicare== SLICING_NO) && (slic->param_active<h_no ))
- {
- h_no = h;
- }
- }
+ /* we have two competing flags: the priority and the
+ timetoslice function. We pick two handles for
+ 1) highest priority (lowest param_active number)
+ for timetoslice = yes (1)
+ 2) highest priority (lowest param_active number)
+ for timetoslice = don't care (0)
+ set the active_slicing_handle to one of the two handles
+ in this order
+ */
+ if ((slic->param_active>0))
+ {
+ doicare = 0;
+ if (slic->timetoslice!=NULL)
+ {
+ doicare = slic->timetoslice(GH);
+ }
+ if ((doicare== SLICING_YES) && (slic->param_active<h_yes))
+ {
+ h_yes = h;
+ }
+ if ((doicare== SLICING_DONTCARE) && (slic->param_active<h_egal))
+ {
+ h_egal= h;
+ }
+ if ((doicare== SLICING_NO) && (slic->param_active<h_no ))
+ {
+ h_no = h;
+ }
+ }
#ifdef ESLIC_DEBUG
- printf(" handle:%d name:%s param_active:%d h_yes:%d h_egal:%d \n",
- h,slic->name,slic->param_active,h_yes, h_egal);
+ printf(" handle:%d name:%s param_active:%d h_yes:%d h_egal:%d \n",
+ h,slic->name,slic->param_active,h_yes, h_egal);
#endif
}
}
@@ -564,7 +564,7 @@ void Einstein_SetNextSlicing(cGH *GH)
else
{
printf("ERROR: no active slicing found: hyes/hegal/hno: %d %d %d \n",
- h_yes,h_egal,h_no);
+ h_yes,h_egal,h_no);
}
}
@@ -579,7 +579,7 @@ void Einstein_SetNextSlicing(cGH *GH)
}
sprintf(info,"Next slicing: %s (%d)",
- slic->name,*active_slicing_handle);
+ slic->name,*active_slicing_handle);
CCTK_INFO(info);
if (info) free(info);
}