24 #ifndef EMPIRICAL_SPRING_ELEMENT_PROCESS_H
25 #define EMPIRICAL_SPRING_ELEMENT_PROCESS_H
67 Parameters InputParameters,
const DoubleVector FittedPolynomial):mrModelPart(rModelPart),mParameters(InputParameters),mrFittedPoly(FittedPolynomial)
72 "model_part_name" : "example_part",
73 "computing_model_part_name" : "computing_domain",
77 "displacement_data" : [0.0,1.0,2.0,3.0],
78 "force_data" : [0.0,1.0,2.0,3.0],
79 "polynomial_order" : 3
83 KRATOS_ERROR_IF(mParameters["node_ids"].size()!=2) <<
"exactly two nodes for each spring needed !" << std::endl;
84 KRATOS_ERROR_IF(mParameters[
"displacement_data"].size()!=mParameters[
"force_data"].size()) <<
"only two nodes for each spring allowed !" << std::endl;
105 for (
SizeType i=0;
i<mrFittedPoly.size();++
i) polynomial_order[
i] = mrFittedPoly[
i];
106 const int number_nodes = 2;
109 const std::size_t new_element_id = mParameters[
"element_id"].
GetInt();
112 std::vector<NodeType::Pointer> element_nodes (number_nodes);
115 element_nodes[
i] = mrModelPart.
pGetNode(mParameters[
"node_ids"][
i].GetInt());
120 Properties::Pointer p_elem_prop = mrModelPart.
pGetProperties(mParameters[
"property_id"].GetInt());
123 p_elem_prop->
SetValue(SPRING_DEFORMATION_EMPIRICAL_POLYNOMIAL, polynomial_order);
127 Element::Pointer pElem = rElem.
Create(new_element_id, line_t, p_elem_prop);
Base class for all Elements.
Definition: element.h:60
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new element pointer.
Definition: element.h:202
Definition: empirical_spring_element_process.h:49
void CreateEmpiricalSpringElement() const
this function will be executed at every time step BEFORE performing the solve phase
Definition: empirical_spring_element_process.h:101
std::size_t SizeType
Definition: empirical_spring_element_process.h:59
KRATOS_CLASS_POINTER_DEFINITION(EmpiricalSpringElementProcess)
Pointer definition of ApplyMultipointConstraintsProcess.
Node ::Pointer NodeTypePointer
Definition: empirical_spring_element_process.h:53
Node NodeType
Definition: empirical_spring_element_process.h:52
std::vector< double > DoubleVector
Definition: empirical_spring_element_process.h:57
DoubleVector::iterator DoubleVectorIterator
Definition: empirical_spring_element_process.h:58
std::vector< NodeTypePointer > NodeVector
Definition: empirical_spring_element_process.h:54
std::vector< NodeTypePointer >::iterator NodeIterator
Definition: empirical_spring_element_process.h:56
void ExecuteInitialize() override
Definition: empirical_spring_element_process.h:92
EmpiricalSpringElementProcess(ModelPart &rModelPart, Parameters InputParameters, const DoubleVector FittedPolynomial)
Constructor.
Definition: empirical_spring_element_process.h:66
ModelPart::NodesContainerType NodesArrayType
Definition: empirical_spring_element_process.h:55
void SetValue(const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
Definition: geometry.h:617
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
PropertiesType::Pointer pGetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:664
NodeType::Pointer pGetNode(IndexType NodeId, IndexType ThisIndex=0)
Definition: model_part.h:421
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
void AddElement(ElementType::Pointer pNewElement, IndexType ThisIndex=0)
Definition: model_part.cpp:917
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
integer i
Definition: TensorModule.f:17