Index: issm/trunk-jpl/src/jl/solve/analyses.jl
===================================================================
--- issm/trunk-jpl/src/jl/solve/analyses.jl	(revision 26632)
+++ issm/trunk-jpl/src/jl/solve/analyses.jl	(revision 26634)
@@ -53,4 +53,8 @@
 
 end#}}}
+function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+	error("STOP")
+end#}}}
+
 function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
 
@@ -65,4 +69,6 @@
 
 end #}}}
+
+
 function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
 
Index: issm/trunk-jpl/src/jl/solve/modules.jl
===================================================================
--- issm/trunk-jpl/src/jl/solve/modules.jl	(revision 26632)
+++ issm/trunk-jpl/src/jl/solve/modules.jl	(revision 26634)
@@ -34,5 +34,4 @@
 	SpcNodesx(nodes,constraints,parameters)
 	NodesDofx(nodes,parameters)
-	error("STOP")
 
 	#Build FemModel
@@ -107,5 +106,35 @@
 function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
 
-	error("not implemented yet")
+	#Do we have any nodes?
+	if length(nodes)==0
+		return
+	end
+
+	#Do we really need to update dof indexing
+	if(~RequiresDofReindexing(nodes)) return end
+
+	print("   Renumbering degrees of freedom\n")
+	DistributeDofs(nodes,GsetEnum)
+	DistributeDofs(nodes,FsetEnum)
+	DistributeDofs(nodes,SsetEnum)
 
 end# }}}
+function GetSolutionFromInputsx(analysis::Analysis,femmodel::FemModel) #{{{
+
+	#Get size of vector
+	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+
+	println(gsize)
+	error("Stop ===")
+
+	#Initialize solution vector
+	ug = Vector{Float64}(undef,gsize)
+
+	#Go through elements and plug in solution
+	for i=1:length(femmodel.elements)
+		GetSolutionFromInputs(analysis,ug,femmodel.elements[i])
+	end
+
+	return ug
+
+end#}}}
Index: issm/trunk-jpl/src/jl/solve/nodes.jl
===================================================================
--- issm/trunk-jpl/src/jl/solve/nodes.jl	(revision 26632)
+++ issm/trunk-jpl/src/jl/solve/nodes.jl	(revision 26634)
@@ -32,2 +32,88 @@
 
 end# }}}
+function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
+
+	if setenum==GsetEnum
+		for i=1:node.gsize
+			node.gdoflist[i] = dofcount
+			dofcount += 1
+		end
+	elseif setenum==FsetEnum
+		for i=1:node.gsize
+			if  node.fdoflist[i]!=-1
+				@assert node.sdoflist[i]==-1
+				node.fdoflist[i] = dofcount
+				dofcount += 1
+			end
+		end
+	elseif setenum==SsetEnum
+		for i=1:node.gsize
+			if  node.sdoflist[i]!=-1
+				@assert node.fdoflist[i]==-1
+				node.sdoflist[i] = dofcount
+				dofcount += 1
+			end
+		end
+	else
+		error("not supported")
+	end
+
+	return dofcount
+end# }}}
+function GetNumberOfDofs(node::Node,setenum::IssmEnum) #{{{
+
+	if setenum==GsetEnum
+		dofcount = node.gsize
+	elseif setenum==FsetEnum
+		dofcount = 0
+		for i=1:node.gsize
+			if  node.fdoflist[i]!=-1
+				dofcount += 1
+			end
+		end
+	elseif setenum==SsetEnum
+		dofcount = 0
+		for i=1:node.gsize
+			if  node.sdoflist[i]!=-1
+				dofcount += 1
+			end
+		end
+	else
+		error("not supported")
+	end
+
+	return dofcount
+
+end# }}}
+
+#Nodes functions
+function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+
+	for i in 1:length(nodes)
+		if nodes[i].indexingupdate
+			return true
+		end
+	end
+
+	return false
+
+end# }}}
+function DistributeDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+
+	dofcount = 1
+
+	for i in 1:length(nodes)
+		dofcount = DistributeDofs(nodes[i],setenum,dofcount)
+	end
+
+
+end# }}}
+function NumberOfDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+
+	numdofs = 0
+	for i in 1:length(nodes)
+		numdofs += GetNumberOfDofs(nodes[i],setenum)
+	end
+	return numdofs
+
+end# }}}
Index: issm/trunk-jpl/src/jl/test101.jl
===================================================================
--- issm/trunk-jpl/src/jl/test101.jl	(revision 26632)
+++ issm/trunk-jpl/src/jl/test101.jl	(revision 26634)
@@ -4,5 +4,6 @@
 
 md = ISSM.model()
-md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
+#md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
+md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
 md = ISSM.setmask(md,"all","")
 
