EquationIdVector

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(New page: void LinearElement::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo) { int number_of_nodes = GetGeometry().size(); int dim = GetGeometry().WorkingSp...)
 
Line 1: Line 1:
 
  void LinearElement::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
 
  void LinearElement::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
 
+
{
+
{
int number_of_nodes = GetGeometry().size();
+
int number_of_nodes = GetGeometry().size();
int dim = GetGeometry().WorkingSpaceDimension();
+
int dim = GetGeometry().WorkingSpaceDimension();
unsigned int dim2 = number_of_nodes*dim;
+
unsigned int dim2 = number_of_nodes*dim;
if(rResult.size() != dim2)
+
if(rResult.size() != dim2)
rResult.resize(dim2);
+
rResult.resize(dim2);
for (int i=0;i<number_of_nodes;i++)
+
for (int i=0;i<number_of_nodes;i++)
{
+
{
int index = i*dim;
+
int index = i*dim;
rResult[index] = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
+
rResult[index] = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
rResult[index + 1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
+
rResult[index + 1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
if(dim == 3)
+
if(dim == 3)
rResult[index + 2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
+
rResult[index + 2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
}
+
}
}
+
}

Revision as of 15:58, 28 November 2007

	void LinearElement::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)

	{
		int number_of_nodes = GetGeometry().size();
		int dim = GetGeometry().WorkingSpaceDimension();
	 	unsigned int dim2 = number_of_nodes*dim;
		if(rResult.size() != dim2)
			rResult.resize(dim2);
		for (int i=0;i<number_of_nodes;i++)
		{
			int index = i*dim;
			rResult[index] = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
			rResult[index + 1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
			if(dim == 3)
			rResult[index + 2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
		}
	}
Personal tools
Categories