[cig-commits] commit: Add some runtime checking to make sure that a material has all of the heating elements it needs

Mercurial hg at geodynamics.org
Tue Jul 13 11:01:20 PDT 2010


changeset:   850:3bcb1e10ea75
user:        Walter Landry <wlandry at caltech.edu>
date:        Mon Jul 12 15:46:16 2010 -0700
files:       Utils/src/RadiogenicHeatingTerm.c
description:
Add some runtime checking to make sure that a material has all of the heating elements it needs


diff -r d6947763978a -r 3bcb1e10ea75 Utils/src/RadiogenicHeatingTerm.c
--- a/Utils/src/RadiogenicHeatingTerm.c	Fri Jul 09 14:52:00 2010 -0700
+++ b/Utils/src/RadiogenicHeatingTerm.c	Mon Jul 12 15:46:16 2010 -0700
@@ -120,6 +120,7 @@ void _RadiogenicHeatingTerm_Build( void*
 	Dictionary_Entry_Value*              list;
 	Dictionary_Entry_Value*              entry;
 	Materials_Register*                  materials_Register = self->materials_Register;
+	Stream*                              errorStream = Journal_Register( Error_Type, (Name)self->type  );
 
 	_ForceTerm_Build( self, data );
 
@@ -132,8 +133,10 @@ void _RadiogenicHeatingTerm_Build( void*
 
 		/* Get List of Heating Elements from material's dictionary */
 		list = Dictionary_Get( material->dictionary, (Dictionary_Entry_Key)"heatingElements" );
+                Journal_Firewall(list!=NULL,errorStream,"Every material must have a heatingElements term.\nThe material '%s' does not have one.",
+                                 material->name);
   		heatingElementCount = Dictionary_Entry_Value_GetCount( list  );
-     	materialExt->heatingElementList = Memory_Alloc_Array( HeatingElement, heatingElementCount, "Heating Element" );
+                materialExt->heatingElementList = Memory_Alloc_Array( HeatingElement, heatingElementCount, "Heating Element" );
   		memset( materialExt->heatingElementList, 0, heatingElementCount * sizeof(HeatingElement) );
   		materialExt->heatingElementCount = heatingElementCount;
   	



More information about the CIG-COMMITS mailing list