Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 23611)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 23612)
@@ -77,5 +77,4 @@
 					./classes/Constraints/SpcTransient.cpp\
 					./classes/DependentObject.cpp\
-					./classes/DofIndexing.cpp\
 					./classes/Contours.cpp\
 					./classes/Vertices.cpp\
Index: sm/trunk-jpl/src/c/classes/DofIndexing.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 23611)
+++ 	(revision )
@@ -1,309 +1,0 @@
-/*!\file DofIndexing.c
- * \brief: implementation of the DofIndexing object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <string.h>
-
-#include "./DofIndexing.h"
-#include "../shared/Numerics/types.h"
-#include "../shared/Numerics/constants.h"
-#include "../shared/io/Print/Print.h"
-#include "../shared/io/Marshalling/Marshalling.h"
-#include "../shared/Exceptions/exceptions.h"
-#include "../shared/MemOps/MemOps.h"
-#include "../shared/Enum/Enum.h"
-
-/*DofIndexing constructors and destructor*/
-DofIndexing::DofIndexing(){/*{{{*/
-
-	this->gsize    = UNDEF;
-	this->fsize    = UNDEF;
-	this->ssize    = UNDEF;
-	this->clone    = false;
-	this->active   = true;
-	this->freeze   = false;
-	this->f_set    = NULL;
-	this->s_set    = NULL;
-	this->svalues  = NULL;
-	this->doftype  = NULL;
-	this->gdoflist = NULL;
-	this->fdoflist = NULL;
-	this->sdoflist = NULL;
-
-}
-/*}}}*/
-DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor/*{{{*/
-
-	this->gsize  = in->gsize;
-	this->fsize  = in->fsize;
-	this->ssize  = in->ssize;
-	this->clone  = in->clone;
-	this->active = in->active;
-	this->freeze = in->freeze;
-
-	if(this->gsize>0){
-		this->f_set=xNew<bool>(this->gsize);
-		this->s_set=xNew<bool>(this->gsize);
-		this->svalues=xNew<IssmDouble>(this->gsize);
-		if(in->doftype){
-			this->doftype=xNew<int>(this->gsize); 
-		}
-		else{
-			this->doftype=NULL;
-		}
-		this->gdoflist=xNew<int>(this->gsize); 
-	}
-	else{
-		this->f_set    = NULL;
-		this->s_set    = NULL;
-		this->svalues  = NULL;
-		this->doftype  = NULL;
-		this->gdoflist = NULL;
-	}
-	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
-	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
-
-	if(this->gsize>0){
-		memcpy(this->f_set,in->f_set,this->gsize*sizeof(bool));
-		memcpy(this->s_set,in->s_set,this->gsize*sizeof(bool));
-		xMemCpy<IssmDouble>(this->svalues,in->svalues,this->gsize);
-		if(this->doftype)memcpy(this->doftype,in->doftype,this->gsize*sizeof(int));
-		memcpy(this->gdoflist,in->gdoflist,this->gsize*sizeof(int));
-	}
-	if(this->fsize>0)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int));
-	if(this->ssize>0)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int));
-
-}
-/*}}}*/
-DofIndexing::~DofIndexing(){ //destructor/*{{{*/
-
-	if(this->f_set) xDelete<bool>(f_set); 
-	if(this->s_set) xDelete<bool>(s_set); 
-	if(this->svalues) xDelete<IssmDouble>(svalues);
-	if(this->doftype) xDelete<int>(doftype); 
-	if(this->gdoflist) xDelete<int>(gdoflist);
-	if(this->fdoflist) xDelete<int>(fdoflist);
-	if(this->sdoflist) xDelete<int>(sdoflist);
-
-}
-/*}}}*/
-void DofIndexing::copy(const DofIndexing& in ){/*{{{*/
-
-	this->gsize  = in.gsize;
-	this->fsize  = in.fsize;
-	this->ssize  = in.ssize;
-	this->clone  = in.clone;
-	this->active = in.active;
-	this->freeze = in.freeze;
-
-	if(this->gsize>0){
-		this->f_set=xNew<bool>(this->gsize);
-		this->s_set=xNew<bool>(this->gsize);
-		this->svalues=xNew<IssmDouble>(this->gsize);
-		if(in.doftype){
-			this->doftype=xNew<int>(this->gsize);
-		}
-		else{
-			this->doftype=NULL;
-		}
-		this->gdoflist=xNew<int>(this->gsize);
-	}
-	else{
-		this->f_set    = NULL;
-		this->s_set    = NULL;
-		this->svalues  = NULL;
-		this->doftype  = NULL;
-		this->gdoflist = NULL;
-	}
-	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
-	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
-
-	if(this->gsize>0){
-		memcpy(this->f_set,in.f_set,this->gsize*sizeof(bool));
-		memcpy(this->s_set,in.s_set,this->gsize*sizeof(bool));
-		xMemCpy<IssmDouble>(this->svalues,in.svalues,this->gsize);
-		if(this->doftype)memcpy(this->doftype,in.doftype,this->gsize*sizeof(int));
-		memcpy(this->gdoflist,in.gdoflist,this->gsize*sizeof(int));
-	}
-	if(this->fsize>0)memcpy(this->fdoflist,in.fdoflist,this->fsize*sizeof(int));
-	if(this->ssize>0)memcpy(this->sdoflist,in.sdoflist,this->ssize*sizeof(int));
-
-	return;
-}
-/*}}}*/
-void DofIndexing::Init(int in_gsize,bool isclone,int* in_doftype){/*{{{*/
-
-	this->gsize = in_gsize;
-
-	/*At this point, assume this is not a clone (will be dealt with later)*/
-	this->clone = isclone;
-
-	/*memory allocation */
-	if(this->gsize>0){
-		this->f_set    = xNew<bool>((unsigned int)in_gsize);
-		this->s_set    = xNew<bool>((unsigned int)in_gsize);
-		this->svalues  = xNew<IssmDouble>((unsigned int)in_gsize);
-		this->gdoflist = xNew<int>((unsigned int)in_gsize);
-
-		if(in_doftype) this->doftype = xNew<int>((unsigned int)in_gsize);
-		else this->doftype = NULL;
-	}
-
-	/*Assign values assuming no Dirichlet at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = true;
-		this->s_set[i]    = false;
-		this->svalues[i]  = 0.;      //0 constraint is the default value
-		this->gdoflist[i] = UNDEF;
-
-		if(this->doftype) this->doftype[i]=in_doftype[i];
-	}
-}
-/*}}}*/
-void DofIndexing::InitSet(int setenum){/*{{{*/
-
-	int i;
-	int size=0;
-
-	/*go through sets, and figure out how many dofs belong to this set, except for g-set, 
-	 * which has already been initialized: */
-	if(setenum==FsetEnum){
-		size=0;
-		for(i=0;i<this->gsize;i++) if(f_set[i])size++;
-		this->fsize=size;
-		xDelete<int>(this->fdoflist);
-
-		if(this->fsize)
-		 this->fdoflist=xNew<int>(size);
-		else
-		 this->fdoflist=NULL;
-	}
-	else if(setenum==SsetEnum){
-		size=0;
-		for(i=0;i<this->gsize;i++) if(s_set[i])size++;
-		this->ssize=size;
-		xDelete<int>(this->sdoflist);
-
-		if(this->ssize)
-		 this->sdoflist=xNew<int>(size);
-		else
-		 this->sdoflist=NULL;
-	}
-	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
-}
-/*}}}*/
-
-/*Some of the Object functionality: */
-void DofIndexing::Activate(void){/*{{{*/
-
-	this->active = true;
-
-	/*Constrain to 0. at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = true;
-		this->s_set[i]    = false;
-		this->svalues[i]  = 0.; 
-	}
-	return;
-}
-/*}}}*/
-void DofIndexing::Deactivate(void){/*{{{*/
-	this->active = false;
-
-	/*Constrain to 0. at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = false;
-		this->s_set[i]    = true;
-		this->svalues[i]  = 0.; 
-	}
-	return;
-}
-/*}}}*/
-void DofIndexing::DeepEcho(void){/*{{{*/
-
-	int i;
-
-	_printf_("DofIndexing:\n");
-	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
-	_printf_("   clone:  " << clone << "\n");
-	_printf_("   active: " << active << "\n");
-	_printf_("   freeze: " << freeze << "\n");
-
-	_printf_("   f_set = [ ");
-	for(i=0;i<gsize;i++) _printf_((f_set[i]?1:0)<< " ");
-	_printf_("]\n");
-	_printf_("   s_set = [ ");
-	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
-	_printf_("]\n");
-
-	_printf_("   svalues (" << this->ssize << "): |");
-	for(i=0;i<this->gsize;i++){
-		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
-	}
-	_printf_("\n");
-
-	if(doftype){
-		_printf_("   doftype: |");
-		for(i=0;i<gsize;i++){
-			_printf_(" " << doftype[i] << " |");
-		}
-		_printf_("\n");
-	}
-	else _printf_("   doftype: NULL\n");
-
-	_printf_("   g_doflist (" << this->gsize << "): |");
-	for(i=0;i<this->gsize;i++){
-		_printf_(" " << gdoflist[i] << " |");
-	}
-	_printf_("\n");
-
-	_printf_("   f_doflist (" << this->fsize << "): |");
-	for(i=0;i<this->fsize;i++){
-		_printf_(" " << fdoflist[i] << " |");
-	}
-	_printf_("\n");
-
-	_printf_("   s_doflist (" << this->ssize << "): |");
-	for(i=0;i<this->ssize;i++){
-		_printf_(" " << sdoflist[i] << " |");
-	}
-	_printf_("\n");
-}		
-/*}}}*/
-void DofIndexing::Echo(void){/*{{{*/
-
-	_printf_("DofIndexing:\n");
-	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
-	_printf_("   clone:  " << clone << "\n");
-	_printf_("   active: " << active << "\n");
-	_printf_("   freeze: " << freeze << "\n");
-}
-/*}}}*/
-void DofIndexing::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
-
-	MARSHALLING(gsize);
-	MARSHALLING(fsize);
-	MARSHALLING(ssize);
-	MARSHALLING(clone);
-	MARSHALLING(active);
-	MARSHALLING(freeze);
-	MARSHALLING_DYNAMIC(f_set,bool,gsize);
-	MARSHALLING_DYNAMIC(s_set,bool,gsize);
-	MARSHALLING_DYNAMIC(svalues,IssmDouble,gsize);
-	MARSHALLING_DYNAMIC(doftype,int,gsize);
-	MARSHALLING_DYNAMIC(gdoflist,int,gsize);
-	MARSHALLING_DYNAMIC(fdoflist,int,fsize);
-	MARSHALLING_DYNAMIC(sdoflist,int,ssize);
-
-}
-/*}}}*/
Index: sm/trunk-jpl/src/c/classes/DofIndexing.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/DofIndexing.h	(revision 23611)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*!\file: DofIndexing.h
- * \brief prototype for DofIndexing.h
- */ 
-
-#ifndef _DOFINDEXING_H_
-#define _DOFINDEXING_H_
-
-#include "../shared/Numerics/types.h"
-
-class DofIndexing{
-
-	public:
-
-		/*sizes: */
-		int gsize;   //number of dofs for a node
-		int fsize;   //number of dofs solver for
-		int ssize;   //number of constrained dofs
-
-		/*partitioning: */
-		bool clone;  //this node is replicated from another one
-		bool active; //Is this node active or inactive (all dofs are constrained)
-		bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
-
-		/*boundary conditions sets: */
-		bool       *f_set;     //is dof on f-set (on which we solve)
-		bool       *s_set;     //is dof on s-set (on which boundary conditions -dirichlet- are applied)
-		IssmDouble *svalues;   //list of constraint values. size g_size, for ease of use.
-
-		/*types of dofs: */
-		int        *doftype;   //approximation type of the dofs (used only for coupling), size g_size
-
-		/*list of degrees of freedom: */
-		int *gdoflist;   //dof list in g_set
-		int *fdoflist;   //dof list in f_set
-		int *sdoflist;   //dof list in s_set
-
-		/*DofIndexing constructors, destructors*/
-		DofIndexing();
-		void Init(int g_size,bool isclone,int* doftype);
-		void InitSet(int setenum);
-		DofIndexing(DofIndexing* properties);
-		~DofIndexing();
-		/*Object like functionality:*/
-		void  copy(const DofIndexing& in);
-		void  DeepEcho(void); 
-		void  Echo(void); 
-		void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
-		/*DofIndexing management:*/
-		void Activate(void);
-		void Deactivate(void);
-		DofIndexing* Spawn(int* indices, int numindices);
-
-};
-#endif //ifndef _DOFINDEXING_H_
Index: /issm/trunk-jpl/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23612)
@@ -2970,5 +2970,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -2978,5 +2978,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -2986,5 +2986,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 23612)
@@ -272,5 +272,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->indexing.fsize){
+				if(node->fsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -280,5 +280,5 @@
 				break;
 			case GsetEnum:
-				if(node->indexing.gsize){
+				if(node->gsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -288,5 +288,5 @@
 				break;
 			case SsetEnum:
-				if(node->indexing.ssize){
+				if(node->ssize){
 					if(this->node->IsClone())
 					 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 23612)
@@ -305,5 +305,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -313,5 +313,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -321,5 +321,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 23612)
@@ -404,5 +404,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -412,5 +412,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -420,5 +420,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 23612)
@@ -317,5 +317,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->indexing.fsize){
+				if(node->fsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -325,5 +325,5 @@
 				break;
 			case GsetEnum:
-				if(node->indexing.gsize){
+				if(node->gsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -333,5 +333,5 @@
 				break;
 			case SsetEnum:
-				if(node->indexing.ssize){
+				if(node->ssize){
 					if(this->node->IsClone())
 					 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 23612)
@@ -240,5 +240,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -248,5 +248,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -256,5 +256,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 23612)
@@ -401,5 +401,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -409,5 +409,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -417,5 +417,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk-jpl/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 23612)
@@ -19,11 +19,21 @@
 Node::Node(){/*{{{*/
 	this->approximation=0;
-}
-/*}}}*/
-Node::Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int in_approximation,bool isamr){/*{{{*/
-
-	/*Intermediary*/
-	int k,l;
-	int *doftypes = NULL;
+
+	this->gsize    = -1;
+	this->fsize    = -1;
+	this->ssize    = -1;
+	this->clone    = false;
+	this->active   = true;
+	this->freeze   = false;
+	this->f_set    = NULL;
+	this->s_set    = NULL;
+	this->svalues  = NULL;
+	this->doftype  = NULL;
+	this->gdoflist = NULL;
+	this->fdoflist = NULL;
+	this->sdoflist = NULL;
+}
+/*}}}*/
+Node::Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool node_clone,IoModel* iomodel,int node_analysis,int in_approximation,bool isamr){/*{{{*/
 
 	/*id: */
@@ -32,17 +42,43 @@
 	this->lid           = node_lid;
 	this->pid           = node_pid;
-	this->analysis_enum = analysis_enum;
+	this->analysis_enum = node_analysis;
+	this->clone         = node_clone;
 
 	/*Initialize coord_system: Identity matrix by default*/
-	for(k=0;k<3;k++) for(l=0;l<3;l++) this->coord_system[k][l]=0.0;
-	for(k=0;k<3;k++) this->coord_system[k][k]=1.0;
+	for(int k=0;k<3;k++) for(int l=0;l<3;l++) this->coord_system[k][l]=0.0;
+	for(int k=0;k<3;k++) this->coord_system[k][k]=1.0;
+
+	this->gsize    = -1;
+	this->fsize    = -1;
+	this->ssize    = -1;
+	this->active   = true;
+	this->freeze   = false;
+	this->f_set    = NULL;
+	this->s_set    = NULL;
+	this->svalues  = NULL;
+	this->doftype  = NULL;
+	this->gdoflist = NULL;
+	this->fdoflist = NULL;
+	this->sdoflist = NULL;
 
 	/*indexing:*/
 	this->indexingupdate = true;
-
-	Analysis* analysis = EnumToAnalysis(analysis_enum);
-	int numdofs        = analysis->DofsPerNode(&doftypes,iomodel->domaintype,in_approximation);
-	indexing.Init(numdofs,isclone,doftypes);
-	xDelete<int>(doftypes);
+	Analysis *analysis = EnumToAnalysis(analysis_enum);
+	int      *doftypes = NULL;
+	this->gsize = analysis->DofsPerNode(&this->doftype,iomodel->domaintype,in_approximation);
+	if(this->gsize>0){
+		this->f_set    = xNew<bool>(this->gsize);
+		this->s_set    = xNew<bool>(this->gsize);
+		this->svalues  = xNew<IssmDouble>(this->gsize);
+		this->gdoflist = xNew<int>(this->gsize);
+	}
+
+	/*Assign values assuming no Dirichlet at this point*/
+	for(int i=0;i<this->gsize;i++){
+		this->f_set[i]    = true;
+		this->s_set[i]    = false;
+		this->svalues[i]  = 0.;
+		this->gdoflist[i] = -1;
+	}
 	delete analysis;
 
@@ -80,5 +116,5 @@
 			if(in_approximation==SSAFSApproximationEnum && reCast<int>(iomodel->Data("md.flowequation.borderSSA")[io_index])){
 				if(!reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){
-					for(k=0;k<=1;k++) this->FreezeDof(k);
+					for(int k=0;k<=1;k++) this->FreezeDof(k);
 				}
 			}
@@ -124,10 +160,16 @@
 /*}}}*/
 Node::~Node(){/*{{{*/
+
+	if(this->f_set) xDelete<bool>(f_set); 
+	if(this->s_set) xDelete<bool>(s_set); 
+	if(this->svalues) xDelete<IssmDouble>(svalues);
+	if(this->doftype) xDelete<int>(doftype); 
+	if(this->gdoflist) xDelete<int>(gdoflist);
+	if(this->fdoflist) xDelete<int>(fdoflist);
+	if(this->sdoflist) xDelete<int>(sdoflist);
 	return;
 }
 /*}}}*/
 Object* Node::copy(void){/*{{{*/
-
-	int k,l;
 
 	/*output: */
@@ -146,9 +188,33 @@
 
 	/*Initialize coord_system: */
-	for(k=0;k<3;k++) for(l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l];
+	for(int k=0;k<3;k++) for(int l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l];
 
 	/*indexing:*/
 	output->indexingupdate = this->indexingupdate;
-	output->indexing.copy(this->indexing);
+	output->gsize  = this->gsize;
+	output->fsize  = this->fsize;
+	output->ssize  = this->ssize;
+	output->clone  = this->clone;
+	output->active = this->active;
+	output->freeze = this->freeze;
+	if(output->gsize>0){
+		output->f_set=xNew<bool>(output->gsize);
+		output->s_set=xNew<bool>(output->gsize);
+		output->svalues=xNew<IssmDouble>(output->gsize);
+		if(this->doftype) output->doftype=xNew<int>(output->gsize);
+		output->gdoflist=xNew<int>(output->gsize);
+	}
+	if(output->fsize>0)output->fdoflist=xNew<int>(output->fsize);
+	if(output->ssize>0)output->sdoflist=xNew<int>(output->ssize);
+
+	if(output->gsize>0){
+		memcpy(output->f_set,this->f_set,output->gsize*sizeof(bool));
+		memcpy(output->s_set,this->s_set,output->gsize*sizeof(bool));
+		xMemCpy<IssmDouble>(output->svalues,this->svalues,output->gsize);
+		if(output->doftype)memcpy(output->doftype,this->doftype,output->gsize*sizeof(int));
+		memcpy(output->gdoflist,this->gdoflist,output->gsize*sizeof(int));
+	}
+	if(output->fsize>0)memcpy(output->fdoflist,this->fdoflist,output->fsize*sizeof(int));
+	if(output->ssize>0)memcpy(output->sdoflist,this->sdoflist,output->ssize*sizeof(int));
 
 	return (Object*)output; 
@@ -163,14 +229,27 @@
 	MARSHALLING(pid);
 	MARSHALLING(indexingupdate);
-	indexing.Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	MARSHALLING(analysis_enum);
 	MARSHALLING_ARRAY(coord_system,IssmDouble,9);
 
-}
-/*}}}*/
+	MARSHALLING(gsize);
+	MARSHALLING(fsize);
+	MARSHALLING(ssize);
+	MARSHALLING(clone);
+	MARSHALLING(active);
+	MARSHALLING(freeze);
+	MARSHALLING_DYNAMIC(f_set,bool,gsize);
+	MARSHALLING_DYNAMIC(s_set,bool,gsize);
+	MARSHALLING_DYNAMIC(svalues,IssmDouble,gsize);
+	MARSHALLING_DYNAMIC(doftype,int,gsize);
+	MARSHALLING_DYNAMIC(gdoflist,int,gsize);
+	MARSHALLING_DYNAMIC(fdoflist,int,fsize);
+	MARSHALLING_DYNAMIC(sdoflist,int,ssize);
+} /*}}}*/
 
 /*Object virtual functions definitions:*/
 void Node::DeepEcho(void){/*{{{*/
 
+	int i;
 	_printf_("Node:\n");
 	_printf_("   id: " << id << "\n");
@@ -179,5 +258,47 @@
 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
-	indexing.DeepEcho();
+	_printf_("   gsize:  " << gsize << "\n");
+	_printf_("   fsize:  " << fsize << "\n");
+	_printf_("   ssize:  " << ssize << "\n");
+	_printf_("   clone:  " << clone << "\n");
+	_printf_("   active: " << active << "\n");
+	_printf_("   freeze: " << freeze << "\n");
+	_printf_("   f_set = [ ");
+	for(i=0;i<gsize;i++) _printf_((f_set[i]?1:0)<< " ");
+	_printf_("]\n");
+	_printf_("   s_set = [ ");
+	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
+	_printf_("]\n");
+	_printf_("   svalues (" << this->ssize << "): |");
+	for(i=0;i<this->gsize;i++){
+		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
+	}
+	_printf_("\n");
+	if(doftype){
+		_printf_("   doftype: |");
+		for(i=0;i<gsize;i++){
+			_printf_(" " << doftype[i] << " |");
+		}
+		_printf_("\n");
+	}
+	else _printf_("   doftype: NULL\n");
+
+	_printf_("   g_doflist (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++){
+		_printf_(" " << gdoflist[i] << " |");
+	}
+	_printf_("\n");
+
+	_printf_("   f_doflist (" << this->fsize << "): |");
+	for(i=0;i<this->fsize;i++){
+		_printf_(" " << fdoflist[i] << " |");
+	}
+	_printf_("\n");
+
+	_printf_("   s_doflist (" << this->ssize << "): |");
+	for(i=0;i<this->ssize;i++){
+		_printf_(" " << sdoflist[i] << " |");
+	}
+	_printf_("\n");
 
 }
@@ -193,6 +314,10 @@
 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
-	indexing.Echo();
-
+	_printf_("   gsize:  " << gsize << "\n");
+	_printf_("   fsize:  " << fsize << "\n");
+	_printf_("   ssize:  " << ssize << "\n");
+	_printf_("   clone:  " << clone << "\n");
+	_printf_("   active: " << active << "\n");
+	_printf_("   freeze: " << freeze << "\n");
 }
 /*}}}*/
@@ -218,14 +343,14 @@
 	_assert_(!this->indexingupdate);
 	if(setenum==GsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.gsize);
-		return indexing.gdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<gsize);
+		return gdoflist[dofindex];
 	}
 	else if(setenum==FsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.fsize);
-		return indexing.fdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<fsize);
+		return fdoflist[dofindex];
 	}
 	else if(setenum==SsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.ssize);
-		return indexing.sdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<ssize);
+		return sdoflist[dofindex];
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -240,16 +365,16 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
-		if(setenum==FsetEnum)for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
-		if(setenum==SsetEnum)for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
+		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
+		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
 	}
 	else{
 
 		if(setenum==GsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						outdoflist[count]=indexing.gdoflist[i];
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						outdoflist[count]=gdoflist[i];
 						count++;
 					}
@@ -257,14 +382,14 @@
 				_assert_(count); //at least one dof should be the approximation requested
 			}
-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
+			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
 		}
 		else if(setenum==FsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.f_set[i]){
-						if(indexing.doftype[i]==approximation_enum){
-							outdoflist[count]=indexing.fdoflist[count2];
+				for(i=0;i<this->gsize;i++){
+					if(f_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=fdoflist[count2];
 							count++;
 						}
@@ -273,14 +398,14 @@
 				}
 			}
-			else for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
+			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
 		}
 		else if(setenum==SsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.s_set[i]){
-						if(indexing.doftype[i]==approximation_enum){
-							outdoflist[count]=indexing.sdoflist[count2];
+				for(i=0;i<this->gsize;i++){
+					if(s_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=sdoflist[count2];
 							count++;
 						}
@@ -289,5 +414,5 @@
 				}
 			}
-			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
 		}
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -303,9 +428,9 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=i;
 		else if(setenum==FsetEnum){
 			count=0;
-			for(i=0;i<this->indexing.gsize;i++){
-				if(indexing.f_set[i]){
+			for(i=0;i<this->gsize;i++){
+				if(f_set[i]){
 					outdoflist[count]=i;
 					count++;
@@ -315,6 +440,6 @@
 		else if(setenum==SsetEnum){
 			count=0;
-			for(i=0;i<this->indexing.gsize;i++){
-				if(indexing.s_set[i]){
+			for(i=0;i<this->gsize;i++){
+				if(s_set[i]){
 					outdoflist[count]=i;
 					count++;
@@ -327,8 +452,8 @@
 
 		if(setenum==GsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
 						outdoflist[count]=count;
 						count++;
@@ -337,14 +462,14 @@
 				_assert_(count);
 			}
-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+			else for(i=0;i<this->gsize;i++) outdoflist[i]=i;
 		}
 		else if(setenum==FsetEnum){
 
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						if(indexing.f_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						if(f_set[i]){
 							outdoflist[count]=count2;
 							count++;
@@ -358,6 +483,6 @@
 
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.f_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(f_set[i]){
 						outdoflist[count]=i;
 						count++;
@@ -367,10 +492,10 @@
 		}
 		else if(setenum==SsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						if(indexing.s_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						if(s_set[i]){
 							outdoflist[count]=count2;
 							count++;
@@ -383,6 +508,6 @@
 			else{
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.s_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(s_set[i]){
 						outdoflist[count]=i;
 						count++;
@@ -407,7 +532,12 @@
 void Node::Activate(void){/*{{{*/
 
-	if(!IsActive() && !this->indexing.freeze){
+	if(!IsActive() && !this->freeze){
 		this->indexingupdate = true;
-		indexing.Activate();
+		this->active = true;
+		for(int i=0;i<this->gsize;i++){
+			this->f_set[i]    = true;
+			this->s_set[i]    = false;
+			this->svalues[i]  = 0.; 
+		}
 	}
 
@@ -419,5 +549,5 @@
 	 * dofs are constrained to a certain value (dirichlet boundary condition*/
 	DofInSSet(dof);
-	this->indexing.svalues[dof]=value;
+	this->svalues[dof]=value;
 }
 /*}}}*/
@@ -429,10 +559,10 @@
 
 	/*Recover values for s set and plug them in constraints vector: */
-	if(this->indexing.ssize){
-		values=xNew<IssmDouble>(this->indexing.ssize);
+	if(this->ssize){
+		values=xNew<IssmDouble>(this->ssize);
 		count=0;
-		for(i=0;i<this->indexing.gsize;i++){
-			if(this->indexing.s_set[i]){
-				values[count]=this->indexing.svalues[i];
+		for(i=0;i<this->gsize;i++){
+			if(this->s_set[i]){
+				values[count]=this->svalues[i];
 				_assert_(!xIsNan<IssmDouble>(values[count]));
 				count++;
@@ -441,5 +571,5 @@
 
 		/*Add values into constraint vector: */
-		ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+		ys->SetValues(this->ssize,this->sdoflist,values,INS_VAL);
 	}
 
@@ -451,23 +581,27 @@
 void Node::Deactivate(void){/*{{{*/
 
-	if(IsActive() && !this->indexing.freeze){
+	if(IsActive() && !this->freeze){
 		this->indexingupdate = true;
-		indexing.Deactivate();
-	}
-
-}
-/*}}}*/
+		this->active = false;
+		/*Constrain to 0. at this point*/
+		for(int i=0;i<this->gsize;i++){
+			this->f_set[i]    = false;
+			this->s_set[i]    = true;
+			this->svalues[i]  = 0.; 
+		}
+	}
+} /*}}}*/
 void Node::DofInFSet(int dof){/*{{{*/
 
 	/*Put dof for this node into the f set (ie, this dof will NOT be constrained 
 	 * to a fixed value during computations. Only do this for active nodes. */
-	_assert_(dof<this->indexing.gsize);
-	_assert_(this->indexing.active);
-
-	if(this->indexing.f_set[dof] == 0){
-		if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
+	_assert_(dof<this->gsize);
+	_assert_(this->active);
+
+	if(this->f_set[dof] == 0){
+		if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->indexing.f_set[dof]=1; 
-		this->indexing.s_set[dof]=0;
+		this->f_set[dof]=1; 
+		this->s_set[dof]=0;
 	}
 }
@@ -477,11 +611,11 @@
 	/*Put dof for this node into the s set (ie, this dof will be constrained 
 	 * to a fixed value during computations. */
-	_assert_(dof<this->indexing.gsize);
-
-	if(this->indexing.f_set[dof] == 1){
-		//if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
+	_assert_(dof<this->gsize);
+
+	if(this->f_set[dof] == 1){
+		//if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
-		this->indexing.s_set[dof]=1;
+		this->f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+		this->s_set[dof]=1;
 	}
 }
@@ -491,5 +625,5 @@
 	DofInSSet(dof); //with 0 displacement for this dof.
 	//FIXME: for now we don't want this element to change so we use freeze
-	this->indexing.freeze =true;
+	this->freeze =true;
 
 }
@@ -514,36 +648,36 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if      (setenum==GsetEnum) numdofs=this->indexing.gsize;
-		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
-		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
+		if      (setenum==GsetEnum) numdofs=this->gsize;
+		else if (setenum==FsetEnum) numdofs=this->fsize;
+		else if (setenum==SsetEnum) numdofs=this->ssize;
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 	else{
 		if(setenum==GsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 				numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(this->indexing.doftype[i]==approximation_enum) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.gsize;
+				for(i=0;i<this->gsize;i++){
+					if(this->doftype[i]==approximation_enum) numdofs++;
+				}
+			}
+			else numdofs=this->gsize;
 		}
 		else if (setenum==FsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 				numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.f_set[i])) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.fsize;
+				for(i=0;i<this->gsize;i++){
+					if((this->doftype[i]==approximation_enum) && (this->f_set[i])) numdofs++;
+				}
+			}
+			else numdofs=this->fsize;
 		}
 		else if (setenum==SsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 			numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.ssize;
+				for(i=0;i<this->gsize;i++){
+					if((this->doftype[i]==approximation_enum) && (this->s_set[i])) numdofs++;
+				}
+			}
+			else numdofs=this->ssize;
 		}
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -554,6 +688,6 @@
 void Node::HardDeactivate(void){/*{{{*/
 
-	this->indexing.Deactivate();
-	this->indexing.freeze =true;
+	this->Deactivate();
+	this->freeze =true;
 
 }
@@ -561,5 +695,5 @@
 bool Node::IsActive(void){/*{{{*/
 
-	return indexing.active;
+	return active;
 
 }
@@ -567,5 +701,5 @@
 int  Node::IsClone(){/*{{{*/
 
-	return indexing.clone;
+	return clone;
 
 }
@@ -581,5 +715,5 @@
 	/*Dof should be added to the f-set, and taken out of the s-set:*/
 	DofInFSet(dof);
-	this->indexing.svalues[dof]=0.;
+	this->svalues[dof]=0.;
 }
 /*}}}*/
@@ -599,42 +733,42 @@
 	int ind_ys = *pindex_ys;
 
-	if(this->indexing.fsize){
-		int*        indices = xNew<int>(this->indexing.fsize);
-		IssmDouble* values  = xNew<IssmDouble>(this->indexing.fsize);
+	if(this->fsize){
+		int*        indices = xNew<int>(this->fsize);
+		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
 
 		int count = 0;
-		for(int i=0;i<this->indexing.gsize;i++){
-			if(this->indexing.f_set[i]){
+		for(int i=0;i<this->gsize;i++){
+			if(this->f_set[i]){
 				_assert_(local_uf);
-				_assert_(this->indexing.fdoflist[count]==indices_uf[ind_uf]);
+				_assert_(this->fdoflist[count]==indices_uf[ind_uf]);
 
 				values[count]=local_uf[ind_uf];
-				indices[count]=this->indexing.gdoflist[i];
+				indices[count]=this->gdoflist[i];
 				count++;
 				ind_uf++;
 			}
 		}
-		ug->SetValues(this->indexing.fsize,indices,values,INS_VAL);
+		ug->SetValues(this->fsize,indices,values,INS_VAL);
 		/*Free ressources:*/
 		xDelete<IssmDouble>(values);
 		xDelete<int>(indices);
 	}
-	if(this->indexing.ssize){
-		int*        indices = xNew<int>(this->indexing.ssize);
-		IssmDouble* values  = xNew<IssmDouble>(this->indexing.ssize);
+	if(this->ssize){
+		int*        indices = xNew<int>(this->ssize);
+		IssmDouble* values  = xNew<IssmDouble>(this->ssize);
 
 		int count = 0;
-		for(int i=0;i<this->indexing.gsize;i++){
-			if(this->indexing.s_set[i]){
+		for(int i=0;i<this->gsize;i++){
+			if(this->s_set[i]){
 				_assert_(local_ys);
-				_assert_(this->indexing.sdoflist[count]==indices_ys[ind_ys]);
+				_assert_(this->sdoflist[count]==indices_ys[ind_ys]);
 
 				values[count]=local_ys[ind_ys];
-				indices[count]=this->indexing.gdoflist[i];
+				indices[count]=this->gdoflist[i];
 				count++;
 				ind_ys++;
 			}
 		}
-		ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
+		ug->SetValues(this->ssize,indices,values,INS_VAL);
 		/*Free ressources:*/
 		xDelete<IssmDouble>(values);
@@ -654,11 +788,11 @@
 
 	if(setenum==FsetEnum){
-		if(this->indexing.fsize){
- 			values=xNew<IssmDouble>(this->indexing.fsize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.f_set[i]){
+		if(this->fsize){
+ 			values=xNew<IssmDouble>(this->fsize);
+
+			for(i=0;i<this->gsize;i++){
+				if(this->f_set[i]){
 					_assert_(ug_serial);
-					values[count]=ug_serial[this->indexing.gdoflist[i]];
+					values[count]=ug_serial[this->gdoflist[i]];
 					count++;
 				}
@@ -666,15 +800,15 @@
 
 			/*Add values into ug: */
-			vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL);
+			vector->SetValues(this->fsize,this->fdoflist,values,INS_VAL);
 		}
 	}
 	else if(setenum==SsetEnum){
-		if(this->indexing.ssize){
-			values=xNew<IssmDouble>(this->indexing.ssize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.s_set[i]){
+		if(this->ssize){
+			values=xNew<IssmDouble>(this->ssize);
+
+			for(i=0;i<this->gsize;i++){
+				if(this->s_set[i]){
 					_assert_(ug_serial);
-					values[count]=ug_serial[this->indexing.gdoflist[i]];
+					values[count]=ug_serial[this->gdoflist[i]];
 					count++;
 				}
@@ -682,5 +816,5 @@
 
 			/*Add values into ug: */
-			vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+			vector->SetValues(this->ssize,this->sdoflist,values,INS_VAL);
 		}
 	}
@@ -701,30 +835,47 @@
 
 	/*Initialize: */
-	if(setenum==FsetEnum) this->indexing.InitSet(setenum);
-	if(setenum==SsetEnum) this->indexing.InitSet(setenum);
+	int size=0;
+	if(setenum==FsetEnum){
+		for(i=0;i<this->gsize;i++) if(f_set[i])size++;
+		this->fsize=size;
+		xDelete<int>(this->fdoflist);
+
+		if(this->fsize)
+		 this->fdoflist=xNew<int>(size);
+		else
+		 this->fdoflist=NULL;
+	}
+	if(setenum==SsetEnum){
+		for(i=0;i<this->gsize;i++) if(s_set[i])size++;
+		this->ssize=size;
+		xDelete<int>(this->sdoflist);
+
+		if(this->ssize)
+		 this->sdoflist=xNew<int>(size);
+		else
+		 this->sdoflist=NULL;
+	}
 
 	/*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/
-	if(indexing.clone){
-		return;
-	}
+	if(clone) return;
 
 	/*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */
 	if(setenum==GsetEnum){
-		for(i=0;i<this->indexing.gsize;i++){
-			indexing.gdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.gsize;
+		for(i=0;i<this->gsize;i++){
+			gdoflist[i]=dofcount+i;
+		}
+		dofcount+=this->gsize;
 	}
 	else if(setenum==FsetEnum){
-		for(i=0;i<this->indexing.fsize;i++){
-			indexing.fdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.fsize;
+		for(i=0;i<this->fsize;i++){
+			fdoflist[i]=dofcount+i;
+		}
+		dofcount+=this->fsize;
 	}
 	else if(setenum==SsetEnum){
-		for(i=0;i<this->indexing.ssize;i++){
-			indexing.sdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.ssize;
+		for(i=0;i<this->ssize;i++){
+			sdoflist[i]=dofcount+i;
+		}
+		dofcount+=this->ssize;
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -738,5 +889,5 @@
 	int i;
 
-	if(indexing.clone){
+	if(clone){
 		/*This node is a clone, don't off_set the dofs!: */
 		return;
@@ -745,11 +896,11 @@
 	/*This node should off_set the dofs, go ahead: */
 	if(setenum==GsetEnum){
-		for(i=0;i<this->indexing.gsize;i++) indexing.gdoflist[i]+=dofcount;
+		for(i=0;i<this->gsize;i++) gdoflist[i]+=dofcount;
 	}
 	else if(setenum==FsetEnum){
-		for(i=0;i<this->indexing.fsize;i++) indexing.fdoflist[i]+=dofcount;
+		for(i=0;i<this->fsize;i++) fdoflist[i]+=dofcount;
 	}
 	else if(setenum==SsetEnum){
-		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
+		for(i=0;i<this->ssize;i++) sdoflist[i]+=dofcount;
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -758,16 +909,16 @@
 void Node::ShowTrueDofs(int* truedofs,int setenum){/*{{{*/
 
-	_assert_(!this->indexing.clone);
+	_assert_(!this->clone);
 
 	/*Ok, we are not a clone, just plug our dofs into truedofs: */
 	switch(setenum){
 		case GsetEnum:
-			for(int j=0;j<this->indexing.gsize;j++) truedofs[j]=indexing.gdoflist[j];
+			for(int j=0;j<this->gsize;j++) truedofs[j]=gdoflist[j];
 			break;
 		case FsetEnum:
-			for(int j=0;j<this->indexing.fsize;j++) truedofs[j]=indexing.fdoflist[j];
+			for(int j=0;j<this->fsize;j++) truedofs[j]=fdoflist[j];
 			break;
 		case SsetEnum:
-			for(int j=0;j<this->indexing.ssize;j++) truedofs[j]=indexing.sdoflist[j];
+			for(int j=0;j<this->ssize;j++) truedofs[j]=sdoflist[j];
 			break;
 		default:
@@ -779,5 +930,5 @@
 void Node::UpdateCloneDofs(int* alltruedofs,int setenum){/*{{{*/
 
-	_assert_(this->indexing.clone);
+	_assert_(this->clone);
 
 	/*Ok, we are a clone node, but we did not create the dofs for this node.
@@ -785,11 +936,11 @@
 	switch(setenum){
 		case GsetEnum:
-			for(int j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=alltruedofs[j];
+			for(int j=0;j<this->gsize;j++) gdoflist[j]=alltruedofs[j];
 			break;
 		case FsetEnum:
-			for(int j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=alltruedofs[j];
+			for(int j=0;j<this->fsize;j++) fdoflist[j]=alltruedofs[j];
 			break;
 		case SsetEnum:
-			for(int j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=alltruedofs[j];
+			for(int j=0;j<this->ssize;j++) sdoflist[j]=alltruedofs[j];
 			break;
 		default:
Index: /issm/trunk-jpl/src/c/classes/Node.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.h	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/Node.h	(revision 23612)
@@ -10,5 +10,4 @@
 #include "../datastructures/datastructures.h"
 #include "../shared/shared.h"
-#include "./DofIndexing.h"
 class  Inputs;
 class  Hook;
@@ -16,6 +15,6 @@
 class  DataSet;
 class  Vertices;
-template <class doubletype> class  Vector;
-template <class doubletype> class  Matrix;
+template <class doubletype> class Vector;
+template <class doubletype> class Matrix;
 class ElementVector;
 class ElementMatrix;
@@ -34,8 +33,30 @@
 		int pid;   // parallel id (specific to this partition)
 
-		int          analysis_enum;
+		bool clone;  //this node is replicated from another one
+		int  analysis_enum;
 		IssmDouble   coord_system[3][3];
 		bool         indexingupdate;
-		DofIndexing  indexing;
+
+		/*sizes: */
+		int gsize;   //number of dofs for a node
+		int fsize;   //number of dofs solver for
+		int ssize;   //number of constrained dofs
+
+		/*Activation*/
+		bool active; //Is this node active or inactive (all dofs are constrained)
+		bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
+
+		/*boundary conditions sets: */
+		bool       *f_set;     //is dof on f-set (on which we solve)
+		bool       *s_set;     //is dof on s-set (on which boundary conditions -dirichlet- are applied)
+		IssmDouble *svalues;   //list of constraint values. size g_size, for ease of use.
+
+		/*types of dofs: */
+		int        *doftype;   //approximation type of the dofs (used only for coupling), size g_size
+
+		/*list of degrees of freedom: */
+		int *gdoflist;   //dof list in g_set
+		int *fdoflist;   //dof list in f_set
+		int *sdoflist;   //dof list in s_set
 
 		/*Node constructors, destructors*/
Index: /issm/trunk-jpl/src/c/classes/classes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/classes.h	(revision 23611)
+++ /issm/trunk-jpl/src/c/classes/classes.h	(revision 23612)
@@ -129,5 +129,4 @@
 /*diverse: */
 #include "./Hook.h"
-#include "./DofIndexing.h"
 #include "./IoModel.h"
 #include "./FemModel.h"
Index: /issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 23612)
@@ -249,5 +249,5 @@
 			Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i));
 			if(!node->IsClone()){
-				for(j=0;j<node->indexing.fsize;j++){
+				for(j=0;j<node->fsize;j++){
 					_assert_(count<m);
 					d_nnz[count]=numberofdofspernode*(d_connectivity[node->Sid()] + all_connectivity_clone[node->Sid()]);
Index: /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 23611)
+++ /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 23612)
@@ -9,22 +9,17 @@
 void GetSolutionFromInputsx(Vector<IssmDouble>** psolution,FemModel* femmodel){
 
-	/*intermediary: */
-	int gsize;
-	int analysisenum;
-
-	/*output: */
-	Vector<IssmDouble>* solution=NULL;
-
 	if(VerboseModule()) _printf0_("   Get solution from inputs\n");
 
-	/*retrive parameters: */
+	/*retrieve parameters: */
+	int analysisenum;
 	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
 
 	/*Get size of vector: */
-	gsize=femmodel->nodes->NumberOfDofs(GsetEnum);
+	int gsize       = femmodel->nodes->NumberOfDofs(GsetEnum);
+	int gsize_local = femmodel->nodes->NumberOfDofsLocal(GsetEnum);
 	if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 ");
 
 	/*Initialize solution: */
-	solution=new Vector<IssmDouble>(gsize);
+	Vector<IssmDouble>* solution=new Vector<IssmDouble>(gsize_local,gsize);
 
 	/*Go through elements and plug solution: */
