15 #if !defined(KRATOS_MESH_SUITE_MODELER_H_INCLUDED )
16 #define KRATOS_MESH_SUITE_MODELER_H_INCLUDED
105 ThisModelPart.
Nodes().clear();
110 ThisModelPart.
Nodes().reserve(
n.len);
111 for(
int i = 0 ;
i <
n.len ;
i++)
113 Node::Pointer p_node = Kratos::Node::Pointer(
new Kratos::Node(0,
n[
i][0],
n[
i][1],
n[
i][2]));
115 ThisModelPart.
Nodes().push_back(p_node);
122 for(
int i_element = 0 ; i_element <
e.len ; i_element++)
126 for(
int i_node = 0 ; i_node <
e[i_element].nv() ; i_node++)
128 temp.push_back(ThisModelPart.
Nodes()(
e[i_element][i_node] + 1));
130 Element::Pointer p_element = rReferenceElement.
Create(i_element + 1,
temp, properties);
131 ThisModelPart.
Elements().push_back(p_element);
143 n[i_node->Id()-1].f.set(n_permanente);
154 std::size_t
id = i_node->Id() - 1;
155 n[id][0] = i_node->X();
156 n[id][1] = i_node->Y();
157 n[id][2] = i_node->Z();
181 nl+=nodo(i_node->X(), i_node->Y() , i_node->Z());
188 if(i_element->GetGeometry().PointsNumber() == 2)
190 elemento
temp(e_segmento);
191 temp[0] = i_element->GetGeometry()[0].Id() - 1;
192 temp[1] = i_element->GetGeometry()[1].Id() - 1;
197 else if(i_element->GetGeometry().PointsNumber() == 3)
199 elemento
temp(e_triangulo);
200 temp[0] = i_element->GetGeometry()[0].Id() - 1;
201 temp[1] = i_element->GetGeometry()[1].Id() - 1;
202 temp[2] = i_element->GetGeometry()[2].Id() - 1;
223 for (
i=1;
i<nlen;
i++)
225 if (nl[
i].
f.es(n_borrado))
continue;
231 bool hayz=pmax[2]-pmin[2]>ERRADM;
232 if (!hayz) tipo.set(m_planaxy);
233 else tipo.reset(m_planaxy);
235 o=
new octree(
n,pmin,pmax,hayz ? 3 : 2);
236 bool puesto,hayrep=
false;
243 for (
i=0;
i<nlen;
i++)
245 if (nl[
i].
f.es(n_borrado))
continue;
252 o->add_no_rep(in,nc,puesto,epsilon);
253 if (puesto)
continue;
256 add_error(Bad_Format);
260 d=
n[nc].distancia(nl[
i]);
264 n[nc].f.set(nl[
i].
f);
265 if (
n[nc].
h>ERRADM&&nl[
i].
h>ERRADM)
266 set_min(
n[nc].
h,nl[
i].
h);
268 set_max(
n[nc].
h,nl[
i].
h);
269 n[nc].v=(
n[nc].v+nl[
i].v)/2;
272 if (haynh)
for (
i=0;
i<nlen;
i++)
274 if (nl[
i].
f.es(n_borrado))
continue;
275 if (nl[
i].
f.noes(n_h))
continue;
281 if (
n[in].
h<ERRADM)
n[in].h=MAXREAL;
287 if (
n[nc].
h>ERRADM&&nl[
i].
h>ERRADM)
288 set_min(
n[nc].
h,nl[
i].
h);
290 set_max(
n[nc].
h,nl[
i].
h);
291 if (
n[nc].
h<ERRADM)
n[nc].h=MAXREAL;
292 n[nc].v=(
n[nc].v+nl[
i].v)/2;
302 for (
i=0;
i<
el.len;
i++)
308 for (haynh=
false,
j=0;
j<nv;
j++)
310 if (
n[ei[
j]=map[ei[
j]]].
f.es(n_h)) haynh=
true;
313 cpline &en=
n[ei[0]].e;
314 for (
j=0;
j<en.len;
j++)
if (ei==
e[en[
j]])
break;
317 add_warning(Repeated_Elements);
322 if (ei[
j]==ei.npos(
j))
331 if (ni.f.noes(n_h))
continue;
332 if (ni.h!=MAXREAL)
continue;
333 d=ni.distancia(
n[ei.nant(
j)]);
334 if (
d>ERRADM) ni.h=
d;
335 d=ni.distancia(
n[ei.npos(
j)]);
336 if (
d>ERRADM&&
d<ni.h) ni.h=
d;
342 for (
j=0;
j<nv;
j++)
n[ei[
j]].
e+=ie;
343 eltipos.set(ei.ftipo());
344 if (
dim==0) fdim.set(m_nodos);
345 else if (
dim==1) fdim.set(m_lin);
346 else if (
dim==2) fdim.set(m_sup);
347 else if (
dim==3) fdim.set(m_vol);
349 if (fdim==m_nodos) tipo.set(m_nodos);
350 if (fdim==m_lin) tipo.set(m_lin);
351 if (fdim==m_sup) tipo.set(m_sup);
352 if (fdim==m_vol) tipo.set(m_vol);
354 else tipo.set(m_nodos);
403 Element const& rReferenceElement,
404 Condition const& rReferenceBoundaryCondition,
405 double my_alpha = 1.4)
409 delaunay(
true,
false);
418 for(
int i = 0 ;
i <
n.len ;
i++)
421 r_node.
X() =
n[
i][0];
422 r_node.
Y() =
n[
i][1];
423 r_node.
Z() =
n[
i][2];
431 for(
int i_element = 0 ; i_element <
e.len ; i_element++)
435 Element::GeometryType::Pointer p_geometry;
437 int nv =
e[i_element].nv();
439 for(
int i_node = 0 ; i_node < nv ; i_node++)
441 int index =
e[i_element][i_node] + 1;
442 temp.push_back(r_model_nodes(index));
447 Element::Pointer p_element = rReferenceElement.
Create(i_element + 1, *p_geometry, properties);
449 ThisModelPart.
Elements().push_back(p_element);
478 i_node->GetSolutionStepValue(IS_BOUNDARY) = 0.00;
479 i_node->GetSolutionStepValue(IS_FREE_SURFACE) = 0.00;
483 for(
int i_bound = 0; i_bound < frontera.len ; i_bound++)
485 for(
int ii = 0 ; ii < frontera[i_bound].n.len ; ii++)
490 if(frontera[i_bound].
e.len > 3)
492 ThisModelPart.
Nodes()[frontera[i_bound].n[ii]+1].GetSolutionStepValue(IS_BOUNDARY) = 1;
496 ThisModelPart.
Nodes()[frontera[i_bound].n[ii]+1].GetSolutionStepValue(IS_BOUNDARY) = 2;
506 if(i_node->GetSolutionStepValue(IS_BOUNDARY) == 1.00 && i_node->GetSolutionStepValue(IS_STRUCTURE) != 1)
507 i_node->GetSolutionStepValue(IS_FREE_SURFACE) = 1.00;
511 for(
int i = 0 ;
i < nn.len ;
i++)
513 int numb_of_neighb = nn[
i].len;
518 neighbours.
reserve(numb_of_neighb);
519 for(
int j = 0;
j<numb_of_neighb;
j++)
523 neighbours.
push_back( r_model_nodes(ii) );
530 (i_node->SolutionStepData()).Update();
614 virtual std::string
Info()
const
735 rOStream << std::endl;
Base class for all Conditions.
Definition: condition.h:59
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
Geometry base class.
Definition: geometry.h:71
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
void push_back(TPointerType x)
Definition: global_pointers_vector.h:322
void clear()
Definition: global_pointers_vector.h:361
void reserve(int dim)
Definition: global_pointers_vector.h:375
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
Short class definition.
Definition: mesh_suite_modeler.h:66
void FixNodes(ModelPart &ThisModelPart)
Definition: mesh_suite_modeler.h:138
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: mesh_suite_modeler.h:620
void ReGenerateMesh(ModelPart &ThisModelPart, Element const &rReferenceElement, Condition const &rReferenceBoundaryCondition, double my_alpha=1.4)
Definition: mesh_suite_modeler.h:401
virtual ~MeshSuiteModeler()
Destructor.
Definition: mesh_suite_modeler.h:82
void GenerateMesh(ModelPart &ThisModelPart, Element const &rReferenceElement)
Definition: mesh_suite_modeler.h:97
int SetMesh(ModelPart &ThisModelPart)
Definition: mesh_suite_modeler.h:167
virtual std::string Info() const
Turn back information as a string.
Definition: mesh_suite_modeler.h:614
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: mesh_suite_modeler.h:623
int UpdateMesh(ModelPart &ThisModelPart)
Definition: mesh_suite_modeler.h:149
MeshSuiteModeler()
Default constructor.
Definition: mesh_suite_modeler.h:79
KRATOS_CLASS_POINTER_DEFINITION(MeshSuiteModeler)
Pointer definition of MeshSuiteModeler.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
double Y() const
Definition: point.h:187
double Z() const
Definition: point.h:193
double X() const
Definition: point.h:181
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
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
f
Definition: generate_convection_diffusion_explicit_element.py:112
h
Definition: generate_droplet_dynamics.py:91
int d
Definition: ode_solve.py:397
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int j
Definition: quadrature.py:648
el
Definition: read_stl.py:25
float temp
Definition: rotating_cone.py:85
alpha_shape
Definition: script.py:120
int dim
Definition: sensitivityMatrix.py:25
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31