16 #ifndef APPLY_WEAK_SLIDING_PROCESS_H
17 #define APPLY_WEAK_SLIDING_PROCESS_H
63 Parameters InputParameters):mrModelPart(rModelPart),mParameters(InputParameters)
68 "model_part_name_slave" : "example_part_slave",
69 "model_part_name_master" : "example_part_master",
70 "computing_model_part_name" : "Structure",
93 mCurrentElementId = mParameters[
"element_id"].
GetInt();
103 for (
IndexType element_id=mParameters[
"element_id"].GetInt();element_id<mCurrentElementId;element_id++)
120 for(
NodeType& node_i : r_nodes_slave)
125 std::vector<NodeType::Pointer> element_nodes (number_nodes);
127 element_nodes[0] = master_model_part.
pGetNode(neighbour_nodes[0]);
128 element_nodes[1] = master_model_part.
pGetNode(neighbour_nodes[1]);
129 element_nodes[2] = slave_model_part.
pGetNode(node_i.Id());
134 Properties::Pointer p_elem_prop = slave_model_part.
pGetProperties(mParameters[
"property_id"].GetInt());
135 Element::Pointer pElem = rElem.
Create(mCurrentElementId++, triangle_t, p_elem_prop);
148 double distance = 1e12;
149 double distance_i = 0.0;
150 std::vector<std::size_t> neighbour_ids = {0,0};
153 for(
NodeType& node_j : r_nodes_master)
156 if (distance_i<distance)
159 neighbour_ids[0] = node_j.Id();
165 for(
NodeType& node_j : r_nodes_master)
167 if (node_j.Id()==neighbour_ids[0])
continue;
170 if (distance_i<distance)
173 neighbour_ids[1] = node_j.Id();
177 if (mParameters[
"debug_info"].GetBool())
181 std::cout <<
"_________________________" << std::endl;
183 return neighbour_ids;
Definition: apply_weak_sliding_process.h:41
Tree< KDTreePartition< BucketType > > KDTree
Definition: apply_weak_sliding_process.h:55
std::vector< NodeTypePointer > NodeVector
Definition: apply_weak_sliding_process.h:46
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: apply_weak_sliding_process.h:99
double GetNodalDistance(const NodeType &node_i, const NodeType &node_j)
Definition: apply_weak_sliding_process.h:187
ModelPart::NodesContainerType NodesArrayType
Definition: apply_weak_sliding_process.h:47
Node ::Pointer NodeTypePointer
Definition: apply_weak_sliding_process.h:45
ApplyWeakSlidingProcess(ModelPart &rModelPart, Parameters InputParameters)
Constructor.
Definition: apply_weak_sliding_process.h:62
std::size_t SizeType
Definition: apply_weak_sliding_process.h:51
std::vector< std::size_t > FindNearestNeighbours(const NodeType &node_i)
Definition: apply_weak_sliding_process.h:142
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: apply_weak_sliding_process.h:89
Bucket< 3, NodeType, NodeVector, NodeTypePointer, NodeIterator, DoubleVectorIterator > BucketType
Definition: apply_weak_sliding_process.h:54
DoubleVector::iterator DoubleVectorIterator
Definition: apply_weak_sliding_process.h:50
std::vector< NodeTypePointer >::iterator NodeIterator
Definition: apply_weak_sliding_process.h:48
void ExecuteInitialize() override
Definition: apply_weak_sliding_process.h:82
void CreateElements()
Definition: apply_weak_sliding_process.h:112
std::vector< double > DoubleVector
Definition: apply_weak_sliding_process.h:49
KRATOS_CLASS_POINTER_DEFINITION(ApplyWeakSlidingProcess)
Pointer definition of ApplyMultipointConstraintsProcess.
Node NodeType
Definition: apply_weak_sliding_process.h:44
Short class definition.
Definition: bucket.h:57
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
static double Norm3(const TVectorType &a)
Calculates the norm of vector "a" which is assumed to be of size 3.
Definition: math_utils.h:691
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
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
void RemoveElementFromAllLevels(IndexType ElementId, IndexType ThisIndex=0)
Definition: model_part.cpp:1090
void AddElement(ElementType::Pointer pNewElement, IndexType ThisIndex=0)
Definition: model_part.cpp:917
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
IndexType Id() const
Definition: node.h:262
const PointType & GetInitialPosition() const
Definition: node.h:559
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
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
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
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
BaseType::Pointer Create(PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: triangle_3d_3.h:358
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
integer l
Definition: TensorModule.f:17