Skip to content

Commit

Permalink
revert condition changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunethwarna committed Mar 18, 2024
1 parent d875076 commit 6ab9427
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "custom_conditions/helmholtz_surface_shape_condition.h"
#include "includes/variables.h"
#include "includes/checks.h"
#include "includes/mesh_moving_variables.h"
#include "utilities/atomic_utilities.h"

namespace Kratos
Expand Down Expand Up @@ -168,11 +167,11 @@ void HelmholtzSurfaceShapeCondition::GetValuesVector(VectorType &rValues,
SizeType index = 0;
for (SizeType i_node = 0; i_node < num_nodes; ++i_node) {
rValues[index++] =
rgeom[i_node].FastGetSolutionStepValue(MESH_DISPLACEMENT_X, Step);
rgeom[i_node].FastGetSolutionStepValue(HELMHOLTZ_VECTOR_X, Step);
rValues[index++] =
rgeom[i_node].FastGetSolutionStepValue(MESH_DISPLACEMENT_Y, Step);
rgeom[i_node].FastGetSolutionStepValue(HELMHOLTZ_VECTOR_Y, Step);
rValues[index++] =
rgeom[i_node].FastGetSolutionStepValue(MESH_DISPLACEMENT_Z, Step);
rgeom[i_node].FastGetSolutionStepValue(HELMHOLTZ_VECTOR_Z, Step);
}
}
//******************************************************************************
Expand Down Expand Up @@ -232,13 +231,13 @@ void HelmholtzSurfaceShapeCondition::EquationIdVector(EquationIdVectorType& rRes
if (rResult.size() != dimension * number_of_nodes)
rResult.resize(dimension * number_of_nodes,false);

const SizeType pos = this->GetGeometry()[0].GetDofPosition(MESH_DISPLACEMENT_X);
const SizeType pos = this->GetGeometry()[0].GetDofPosition(HELMHOLTZ_VECTOR_X);

for (IndexType i = 0; i < number_of_nodes; ++i) {
const SizeType index = i * 3;
rResult[index] = GetGeometry()[i].GetDof(MESH_DISPLACEMENT_X,pos).EquationId();
rResult[index + 1] = GetGeometry()[i].GetDof(MESH_DISPLACEMENT_Y,pos+1).EquationId();
rResult[index + 2] = GetGeometry()[i].GetDof(MESH_DISPLACEMENT_Z,pos+2).EquationId();
rResult[index] = GetGeometry()[i].GetDof(HELMHOLTZ_VECTOR_X,pos).EquationId();
rResult[index + 1] = GetGeometry()[i].GetDof(HELMHOLTZ_VECTOR_Y,pos+1).EquationId();
rResult[index + 2] = GetGeometry()[i].GetDof(HELMHOLTZ_VECTOR_Z,pos+2).EquationId();
}

KRATOS_CATCH("")
Expand All @@ -258,9 +257,9 @@ void HelmholtzSurfaceShapeCondition::GetDofList(DofsVectorType& rElementalDofLis
rElementalDofList.reserve(dimension*number_of_nodes);

for (IndexType i = 0; i < number_of_nodes; ++i) {
rElementalDofList.push_back(GetGeometry()[i].pGetDof(MESH_DISPLACEMENT_X));
rElementalDofList.push_back( GetGeometry()[i].pGetDof(MESH_DISPLACEMENT_Y));
rElementalDofList.push_back( GetGeometry()[i].pGetDof(MESH_DISPLACEMENT_Z));
rElementalDofList.push_back(GetGeometry()[i].pGetDof(HELMHOLTZ_VECTOR_X));
rElementalDofList.push_back( GetGeometry()[i].pGetDof(HELMHOLTZ_VECTOR_Y));
rElementalDofList.push_back( GetGeometry()[i].pGetDof(HELMHOLTZ_VECTOR_Z));
}

KRATOS_CATCH("")
Expand All @@ -280,11 +279,11 @@ int HelmholtzSurfaceShapeCondition::Check(const ProcessInfo& rCurrentProcessInfo
// Check that the element's nodes contain all required SolutionStepData and Degrees of freedom
for ( IndexType i = 0; i < number_of_nodes; i++ ) {
const NodeType &rnode = r_geometry[i];
KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(MESH_DISPLACEMENT,rnode)
KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(HELMHOLTZ_VECTOR,rnode)

KRATOS_CHECK_DOF_IN_NODE(MESH_DISPLACEMENT_X, rnode)
KRATOS_CHECK_DOF_IN_NODE(MESH_DISPLACEMENT_Y, rnode)
KRATOS_CHECK_DOF_IN_NODE(MESH_DISPLACEMENT_Z, rnode)
KRATOS_CHECK_DOF_IN_NODE(HELMHOLTZ_VECTOR_X, rnode)
KRATOS_CHECK_DOF_IN_NODE(HELMHOLTZ_VECTOR_Y, rnode)
KRATOS_CHECK_DOF_IN_NODE(HELMHOLTZ_VECTOR_Z, rnode)
}

return check;
Expand Down

0 comments on commit 6ab9427

Please sign in to comment.