Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 5985)
+++ /issm/trunk/src/c/Makefile.am	(revision 5986)
@@ -273,5 +273,4 @@
 					./shared/Elements/GetNumberOfDofs.cpp\
 					./shared/Elements/NewElementMatrix.cpp\
-					./shared/Elements/NewElementVector.cpp\
 					./shared/String/DescriptorIndex.cpp\
 					./shared/String/sharedstring.h\
@@ -833,5 +832,4 @@
 					./shared/Elements/GetNumberOfDofs.cpp\
 					./shared/Elements/NewElementMatrix.cpp\
-					./shared/Elements/NewElementVector.cpp\
 					./shared/String/DescriptorIndex.cpp\
 					./shared/String/sharedstring.h\
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5986)
@@ -3019,5 +3019,5 @@
 	inputs->GetParameterValue(&approximation,ApproximationEnum);
 	if(approximation!=PattynStokesApproximationEnum) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3083,5 +3083,5 @@
 	inputs->GetParameterValue(&approximation,ApproximationEnum);
 	if(approximation!=PattynStokesApproximationEnum) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3206,5 +3206,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3304,5 +3304,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3376,5 +3376,5 @@
 	inputs->GetParameterValue(&approximation,ApproximationEnum);
 	if(approximation!=StokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3444,5 +3444,5 @@
 	inputs->GetParameterValue(&approximation,ApproximationEnum);
 	if(approximation!=StokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3521,5 +3521,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3652,5 +3652,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5986)
@@ -3473,5 +3473,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3517,5 +3517,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3561,5 +3561,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3606,5 +3606,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3667,5 +3667,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -3732,5 +3732,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3786,5 +3786,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -3967,5 +3967,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -4137,5 +4137,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -4204,5 +4204,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -4250,5 +4250,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -4297,5 +4297,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -4352,5 +4352,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -4410,5 +4410,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 5986)
@@ -468,5 +468,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(tria->IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -571,5 +571,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(penta->IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
@@ -645,5 +645,5 @@
 	/*Initialize Element vector and return if necessary*/
 	if(penta->IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 5986)
@@ -600,5 +600,5 @@
 	Tria*  tria=(Tria*)element;
 	if(tria->IsOnWater()) return NULL;
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 5986)
@@ -625,5 +625,5 @@
 	/*check that pengrid is not a clone (penalty to be added only once)*/
 	if (node->IsClone()) return NULL;
-	ElementVector* pe=NewElementVector(&node,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(&node,NUMVERTICES,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
@@ -665,5 +665,5 @@
 	/*Initialize Element matrix and return if necessary*/
 	if(!this->active) return NULL;
-	ElementVector* pe=NewElementVector(&node,1,this->parameters);
+	ElementVector* pe=new ElementVector(&node,1,this->parameters);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 5986)
@@ -590,5 +590,5 @@
 	/*Initialize Element Matrix*/
 	if(this->active) return NULL; /*The penalty is active. No loads implied here.*/
-	ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
+	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
 	/*Get some inputs: */
Index: /issm/trunk/src/c/objects/Numerics/ElementVector.cpp
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementVector.cpp	(revision 5985)
+++ /issm/trunk/src/c/objects/Numerics/ElementVector.cpp	(revision 5986)
@@ -131,53 +131,30 @@
 }
 /*}}}*/
-/*FUNCTION ElementVector::ElementVector(int gsize,int* gglobaldoflist){{{1*/
-ElementVector::ElementVector(int gsize,int* in_gglobaldoflist){
-
-	this->nrows=gsize;
-	this->pf=false;
-	
+/*FUNCTION ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){{{1*/
+ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){
+
+	/*retrieve some parameters: */
+	parameters->FindParam(&this->pf,KffEnum);
+
+	/*get number of dofs in sets g,f and s: */
+	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
+
 	/*fill values with 0: */
 	this->values=(double*)xcalloc(this->nrows,sizeof(double));
 	
-	/*dofs: */
-	if(this->nrows){
-		this->gglobaldoflist=(int*)xmalloc(nrows*sizeof(int));
-		memcpy(this->gglobaldoflist,in_gglobaldoflist,nrows*sizeof(int));
-	}
-	else{
-		this->gglobaldoflist=NULL;
-	}
-	/*not needed: */
-	this->fsize=0;
-	this->flocaldoflist=NULL;
-	this->fglobaldoflist=NULL;
-
-}
-/*}}}*/
-/*FUNCTION ElementVector::ElementVector(int gsize,int* flocaldoflist,int* fglobaldoflist,int fsize){{{1*/
-ElementVector::ElementVector(int gsize,int* in_flocaldoflist,int* in_fglobaldoflist,int in_fsize){
-
-	this->nrows=gsize;
-	this->pf=true;
-	
-	/*fill values with 0: */
-	this->values=(double*)xcalloc(this->nrows,sizeof(double));
-	
-	/*dofs: */
-	this->fsize=in_fsize;
-	if(this->fsize){
-		this->flocaldoflist=(int*)xmalloc(fsize*sizeof(int));
-		this->fglobaldoflist=(int*)xmalloc(fsize*sizeof(int));
-		memcpy(this->flocaldoflist,in_flocaldoflist,fsize*sizeof(int));
-		memcpy(this->fglobaldoflist,in_fglobaldoflist,fsize*sizeof(int));
-	}
-	else{
-		this->flocaldoflist=NULL;
-		this->fglobaldoflist=NULL;
-	}
-	
-	/*not needed: */
-	this->gglobaldoflist=NULL;
-
+	/*Get fsize*/
+	if(pf) fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+	else   fsize=0;
+
+	/*get dof lists for f and s set: */
+	gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+	if(pf){
+		flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+		fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+	}
+	else{
+		flocaldoflist =NULL;
+		fglobaldoflist=NULL;
+	}
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Numerics/ElementVector.h
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementVector.h	(revision 5985)
+++ /issm/trunk/src/c/objects/Numerics/ElementVector.h	(revision 5986)
@@ -13,4 +13,6 @@
 #include "../Object.h"
 #include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+class Node;
 /*}}}*/
 
@@ -35,6 +37,5 @@
 		ElementVector(ElementVector* pe1,ElementVector* pe2);
 		ElementVector(ElementVector* pe1,ElementVector* pe2,ElementVector* pe3);
-		ElementVector(int gsize,int* gglobaldoflist);
-		ElementVector(int gsize,int* flocaldoflist,int* fglobaldoflist,int fsize);
+		ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
 		~ElementVector();
 		/*}}}*/
Index: sm/trunk/src/c/shared/Elements/NewElementVector.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/NewElementVector.cpp	(revision 5985)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*!\file:  NewElementVector.cpp
- * \brief create new element matrix
- */ 
-#include "./elements.h"
-
-ElementVector* NewElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){
-
-	/*parameters: */
-	bool kff=false;
-
-	/*output: */
-	ElementVector* pe=NULL;
-	int gsize;
-	int fsize;
-	int* gglobaldoflist=NULL;
-	int* flocaldoflist=NULL;
-	int* fglobaldoflist=NULL;
-
-	/*retrieve some parameters: */
-	parameters->FindParam(&kff,KffEnum);
-
-	/*get number of dofs in sets g,f and s: */
-	gsize=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
-	if(kff)fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
-
-	/*get dof lists for f and s set: */
-	if(!kff){
-		gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
-	}
-	else{
-		flocaldoflist= GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
-		fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
-	}
-
-	/*constructor for ElementVector: */
-	if(!kff)pe=new ElementVector(gsize,gglobaldoflist);
-	else    pe=new ElementVector(gsize,flocaldoflist,fglobaldoflist,fsize);
-
-	/*Clean-up and return*/
-	xfree((void**)&gglobaldoflist);
-	xfree((void**)&flocaldoflist);
-	xfree((void**)&fglobaldoflist);
-	return pe;
-}
Index: /issm/trunk/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk/src/c/shared/Elements/elements.h	(revision 5985)
+++ /issm/trunk/src/c/shared/Elements/elements.h	(revision 5986)
@@ -17,6 +17,4 @@
 int*           GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum);
 ElementMatrix* NewElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
-ElementVector* NewElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
-//ElementVector* NewElementVector(Nodes** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
 
 inline void printarray(double* array,int lines,int cols=1){
