[cig-commits] r14240 - long/3D/SNAC/trunk/Snac/libSnac/src
echoi at geodynamics.org
echoi at geodynamics.org
Fri Mar 6 08:58:48 PST 2009
Author: echoi
Date: 2009-03-06 08:58:48 -0800 (Fri, 06 Mar 2009)
New Revision: 14240
Modified:
long/3D/SNAC/trunk/Snac/libSnac/src/Stress.c
Log:
* A new journal function , Journal_OFirewall(), is used to catch
nan of inf in the scalar measure of stress only in the optimised mode.
* In the debug mode, Journal_Firewall() is used instead and the inidividual component of stress is tested..
Modified: long/3D/SNAC/trunk/Snac/libSnac/src/Stress.c
===================================================================
--- long/3D/SNAC/trunk/Snac/libSnac/src/Stress.c 2009-03-06 16:53:19 UTC (rev 14239)
+++ long/3D/SNAC/trunk/Snac/libSnac/src/Stress.c 2009-03-06 16:58:48 UTC (rev 14240)
@@ -155,6 +155,16 @@
element->stress = 0.5f * sqrt( 0.5f * fabs( -1.0f * sVolAvg + sOtherAvg ) );
element->hydroPressure = pressure;
+ /* To catch nan or inf in the stress values even in the optimised mode. */
+ /* In the usual DEBUG mode, the above Journal_DFirewalls are sufficient. */
+ /* -- EChoi 03/06/2009. */
+#ifdef NDEBUG
+ Journal_OFirewall( (!isnan(element->stress) && !isinf(element->stress)),
+ self->snacError, __FILE__, __func__, __LINE__,
+ "timeStep=%u rank=%u Element %u: The scalar measure of stress is either nan or infinity",
+ self->timeStep, self->rank, element_lI );
+#endif
+
/* update density with updated pressure */
for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ )
element->tetra[tetra_I].density = phsDensity * (1.0 - alpha * (element->tetra[tetra_I].avgTemp-material->reftemp) + beta * pressure);
More information about the CIG-COMMITS
mailing list