Index: issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- issm/trunk/src/c/objects/FemModel.cpp	(revision 12330)
+++ issm/trunk/src/c/objects/FemModel.cpp	(revision 12706)
@@ -20,15 +20,15 @@
 
 /*Object constructors and destructor*/
-/*FUNCTION FemModel::constructor {{{1*/
+/*FUNCTION FemModel::constructor {{{*/
 FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
 
 	/*intermediary*/
-	int i;
-	int analysis_type;
-	FILE* IOMODEL;
-	extern int my_rank;
+	int         i;
+	int         analysis_type;
+	FILE       *IOMODEL = NULL;
+	extern int  my_rank;
 
 	/*Open input file on cpu 0: */
-	if(my_rank==0) IOMODEL= pfopen(inputfilename ,"rb");
+	if(my_rank==0) IOMODEL = pfopen(inputfilename ,"rb");
 
 	/*Initialize internal data: */
@@ -39,5 +39,5 @@
 	
 	/*Dynamically allocate whatever is a list of length nummodels: */
-	analysis_type_list=(int*)xmalloc(nummodels*sizeof(int));
+	analysis_type_list=xNew<int>(nummodels);
 
 	/*Initialize: */
@@ -50,20 +50,20 @@
 	for(i=0;i<nummodels;i++){
 
-		_printf_(VerboseMProcessor(),"   Processing finite element model of analysis %s:\n",EnumToStringx(analysis_type_list[i]));
+		if(VerboseMProcessor()) _pprintLine_("   Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":");
 		analysis_type=analysis_type_list[i];
 		this->SetCurrentConfiguration(analysis_type);
 	
 		if(i==0){
-			_printf_(VerboseMProcessor(),"      creating vertex degrees of freedom\n");
+			if(VerboseMProcessor()) _pprintLine_("      creating vertex degrees of freedom");
 			VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices
 		}
 
-		_printf_(VerboseMProcessor(),"      resolving node constraints\n");
+		if(VerboseMProcessor()) _pprintLine_("      resolving node constraints");
 		SpcNodesx(nodes,constraints,parameters,analysis_type); 
 
-		_printf_(VerboseMProcessor(),"      creating nodal degrees of freedom\n");
+		if(VerboseMProcessor()) _pprintLine_("      creating nodal degrees of freedom");
 		NodesDofx(nodes,parameters,analysis_type);
 	
-		_printf_(VerboseMProcessor(),"      configuring element and loads\n");
+		if(VerboseMProcessor()) _pprintLine_("      configuring element and loads");
 		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
 	}
@@ -77,6 +77,6 @@
 }
 
-/*}}}1*/
-/*FUNCTION FemModel::destructor {{{1*/
+/*}}}*/
+/*FUNCTION FemModel::destructor {{{*/
 FemModel::~FemModel(){
 
@@ -85,5 +85,5 @@
 
 	/*Delete all the datasets: */
-	xfree((void**)&analysis_type_list);
+	xDelete<int>(analysis_type_list);
 	delete elements;
 	delete nodes;
@@ -96,16 +96,16 @@
 
 }
-/*}}}1*/
+/*}}}*/
 
 /*Object management*/
-/*FUNCTION FemModel::Echo {{{1*/
+/*FUNCTION FemModel::Echo {{{*/
 void FemModel::Echo(void){
 
-	printf("FemModel echo: \n");
-	printf("   number of fem models: %i\n",nummodels);
-	printf("   analysis_type_list: \n");
-	for(int i=0;i<nummodels;i++)printf("     %i: %s\n",i,EnumToStringx(analysis_type_list[i]));
-	printf("   current analysis_type: \n");
-	printf("     %i: %s\n",analysis_counter,EnumToStringx(analysis_type_list[analysis_counter]));
+	_printLine_("FemModel echo: ");
+	_printLine_("   number of fem models: " << nummodels);
+	_printLine_("   analysis_type_list: ");
+	for(int i=0;i<nummodels;i++)_printLine_("     " << i << ": " << EnumToStringx(analysis_type_list[i]));
+	_printLine_("   current analysis_type: ");
+	_printLine_("     " << analysis_counter << ": " << EnumToStringx(analysis_type_list[analysis_counter]));
 
 }
@@ -113,5 +113,5 @@
 
 /*Numerics: */
-/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){{{1*/
+/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){{{*/
 void FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){
 
@@ -129,5 +129,5 @@
 	}
 	if(found!=-1) analysis_counter=found;
-	else _error_("Could not find alias for analysis_type %s in list of FemModel analyses",EnumToStringx(configuration_type));
+	else _error2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
 
 	/*Now, plug analysis_counter and analysis_type inside the parameters: */
@@ -145,11 +145,11 @@
 	if(this->parameters->Exist(PetscOptionsStringsEnum)){
 		PetscOptionsFromAnalysis(this->parameters,analysis_type);
-		_printf_(VerboseSolver(),"      petsc Options set for analysis type: %s\n",EnumToStringx(analysis_type));
+		if(VerboseSolver()) _pprintLine_("      petsc Options set for analysis type: " << EnumToStringx(analysis_type));
 	}
 	#endif
 
 }
-/*}}}1*/
-/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type){{{1*/
+/*}}}*/
+/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type){{{*/
 void FemModel::SetCurrentConfiguration(int configuration_type){
 
@@ -157,3 +157,3 @@
 	this->SetCurrentConfiguration(configuration_type,configuration_type);
 }
-/*}}}1*/
+/*}}}*/
