blob: ebdfca76aa93d34cee832bf5098df3f941140078 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
/*@@
@file RHSNaNCheck.c
@date Mon May 20 09:52:33 2002
@author Ian Hawke
@desc
Check the RHS GFs for NaNs.
@enddesc
@version $Header$
@@*/
#include <stdlib.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "ExternalVariables.h"
static const char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusBase_MoL_RHSNaNCheck_c);
/********************************************************************
********************* Local Data Types ***********************
********************************************************************/
/********************************************************************
********************* Local Routine Prototypes *********************
********************************************************************/
/********************************************************************
***************** Scheduled Routine Prototypes *********************
********************************************************************/
void MoL_NaNCheck(CCTK_ARGUMENTS);
/********************************************************************
********************* Other Routine Prototypes *********************
********************************************************************/
/********************************************************************
********************* Local Data *****************************
********************************************************************/
/********************************************************************
********************* External Routines **********************
********************************************************************/
/*@@
@routine MoL_NaNCheck
@date Mon May 20 09:54:39 2002
@author Ian Hawke
@desc
Check the RHS GFs for NaNs.
@enddesc
@calls
@calledby
@history
@endhistory
@@*/
void MoL_NaNCheck(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
CCTK_INT var;
CCTK_INT num_nans;
const char *check_for = "both";
const char *action_if_found = "just warn";
num_nans = 0;
for (var = 0; var < MoLNumEvolvedVariables; var++)
{
char * const varname = CCTK_FullName(RHSVariableIndex[var]);
num_nans += CheckVarsForNaN(cctkGH,
-1,
varname,
check_for,
action_if_found);
free(varname);
}
if (num_nans)
{
CCTK_VWarn(0,__LINE__,__FILE__,CCTK_THORNSTRING,
"NaNs were found on iteration %d inside MoL",
(int)(MoL_Intermediate_Steps - *MoL_Intermediate_Step + 1));
}
}
/********************************************************************
********************* Local Routines *************************
********************************************************************/
|