52 #if !defined(KRATOS_EMBEDDED_LOCATOR_PROCESS_INCLUDED )
53 #define KRATOS_EMBEDDED_LOCATOR_PROCESS_INCLUDED
61 #include <boost/timer.hpp>
156 for(ModelPart::NodesContainerType::iterator in = embeddedNodes.begin(); in!=embeddedNodes.end(); in++)
158 in->FastGetSolutionStepValue(COUNTER)=0;
161 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
163 in->FastGetSolutionStepValue(COUNTER)=0;
171 unsigned int n_skin_nodes=embedded_model_part.
Nodes().size();
174 double* skin_nodes = NULL;
175 skin_nodes =
new double[n_skin_nodes*3];
177 unsigned int count=0;
180 for(ModelPart::NodesContainerType::iterator in = embeddedNodes.begin(); in!=embeddedNodes.end(); in++)
184 skin_nodes[base]=in->X();
185 skin_nodes[base+1]=in->Y();
186 skin_nodes[base+2]=in->Z();
187 in->FastGetSolutionStepValue(COUNTER)=
count;
196 unsigned int n_skin_faces=embedded_model_part.
Conditions().size();
199 int* skin_faces = NULL;
200 skin_faces =
new int[n_skin_faces*3];
206 for(ModelPart::ConditionsContainerType::iterator ic = embeddedConds.begin() ;
207 ic != embeddedConds.end() ; ++ic)
213 unsigned int position_0=ic->GetGeometry()[0].FastGetSolutionStepValue(COUNTER);
214 unsigned int position_1=ic->GetGeometry()[1].FastGetSolutionStepValue(COUNTER);
215 unsigned int position_2=ic->GetGeometry()[2].FastGetSolutionStepValue(COUNTER);
216 skin_faces[base]=position_0;
217 skin_faces[base+1]=position_1;
218 skin_faces[base+2]=position_2;
227 unsigned int n_vol_nodes=mr_model_part.
Nodes().size();
229 double* vol_nodes = NULL;
230 vol_nodes =
new double[n_vol_nodes*3];
234 double search_radius=0.0;
237 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
241 vol_nodes[base]=in->X();
242 vol_nodes[base+1]=in->Y();
243 vol_nodes[base+2]=in->Z();
244 in->FastGetSolutionStepValue(COUNTER)=
count;
250 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
252 if((in->GetValue(NEIGHBOUR_NODES)).size() != 0)
258 double h = 10000000.0;
260 i != in->GetValue(NEIGHBOUR_NODES).end();
i++)
284 search_radius=4.0*h_max;
285 KRATOS_WATCH(
"=========================EMBEDDED=INPUT=INFO================================================================")
291 if (search_radius<=0.0)
292 KRATOS_THROW_ERROR(std::logic_error,
"error: YOUR SEARCH RADIUS FOR FINDING INTERSECTIONS IS ZERO OR NEGATIVE!!!!!! CHECK IF NODAL H WAS COMPUTED",
"");
299 boost::timer distance_calc_time;
307 std::cout <<
"Distance from embedded object: calculation time = " << distance_calc_time.elapsed() << std::endl;
308 KRATOS_WATCH(
"============================================================================================================")
310 double* distances=NULL;
312 distances=
new double[n_vol_nodes];
317 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
320 count=in->FastGetSolutionStepValue(COUNTER);
321 in->FastGetSolutionStepValue(DISTANCE)=distances[
count];
326 delete [] skin_nodes;
327 delete [] skin_faces;
337 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
339 temp=in->FastGetSolutionStepValue(DISTANCE);
344 const double default_distance=max_dist;
347 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
350 double distance_temp;
351 distance=in->FastGetSolutionStepValue(DISTANCE);
352 if (distance==default_distance)
356 bool inner_elem=
false;
363 for (
unsigned int i=0;
i<neighb.
size();
i++)
365 distance_temp=neighb[
i].FastGetSolutionStepValue(DISTANCE);
366 if (distance_temp<0.0)
371 if (inner_elem==
true)
373 for (
unsigned int i=0;
i<neighb.
size();
i++)
375 if (neighb[
i].FastGetSolutionStepValue(DISTANCE)==default_distance)
376 neighb[
i].FastGetSolutionStepValue(DISTANCE)=-default_distance;
384 while (uncertain==
true)
387 for(ModelPart::NodesContainerType::iterator in = volumeNodes.begin(); in!=volumeNodes.end(); in++)
390 double distance_temp;
391 distance=in->FastGetSolutionStepValue(DISTANCE);
392 if (distance==-default_distance)
395 for (
unsigned int i=0;
i<neighb.
size();
i++)
397 distance_temp=neighb[
i].FastGetSolutionStepValue(DISTANCE);
398 if (distance_temp==default_distance)
400 neighb[
i].FastGetSolutionStepValue(DISTANCE)=-default_distance;
432 virtual std::string
Info()
const
434 return "EmbeddedMeshLocatorProcess";
440 rOStream <<
"EmbeddedMeshLocatorProcess";
559 rOStream << std::endl;
Short class definition.
Definition: embedded_mesh_locator_process.h:109
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: embedded_mesh_locator_process.h:444
KRATOS_CLASS_POINTER_DEFINITION(EmbeddedMeshLocatorProcess)
Pointer definition of EmbeddedMeshLocatorProcess.
virtual std::string Info() const
Turn back information as a string.
Definition: embedded_mesh_locator_process.h:432
EmbeddedMeshLocatorProcess(ModelPart &model_part)
Default constructor.
Definition: embedded_mesh_locator_process.h:122
virtual ~EmbeddedMeshLocatorProcess()
Destructor.
Definition: embedded_mesh_locator_process.h:128
void operator()()
Definition: embedded_mesh_locator_process.h:137
void Locate(ModelPart &embedded_model_part)
Definition: embedded_mesh_locator_process.h:149
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: embedded_mesh_locator_process.h:438
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
size_type size() const
Definition: global_pointers_vector.h:307
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
The base class for all processes in Kratos.
Definition: process.h:49
virtual void Execute()
Execute method is used to execute the Process algorithms.
Definition: process.h:101
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
double * GetAttributesOfNodes(GiDOutput_Handle hdl_gout)
void * GetGidOutputHandle()
GiDInput_Handle GetGidInputHandleWithBoundaryMesh(int ndime, int nlen, double *coords, int flen, int *faces, int type_faces_mesh)
void AddNodesInMesh(GiDInput_Handle hdl_gin, int nlen, double *coord)
void GiDML_GetNodesDistanceRadiusInTetrahedraMesh(GiDInput_Handle hdl_gin, GiDOutput_Handle hdl_gout, double Radius, int cuadratic_distances)
z
Definition: GenerateWind.py:163
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
model_part
Definition: face_heat.py:14
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
h
Definition: generate_droplet_dynamics.py:91
int count
Definition: generate_frictional_mortar_condition.py:212
float temp
Definition: rotating_cone.py:85
float xc
Definition: rotating_cone.py:77
float yc
Definition: rotating_cone.py:78
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17