KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
geometry_tester.h
Go to the documentation of this file.
1 //
2 // | / |
3 // ' / __| _` | __| _ \ __|
4 // . \ | ( | | ( |\__ `
5 // _|\_\_| \__,_|\__|\___/ ____/
6 // Multi-Physics
7 //
8 // License: BSD License
9 // Kratos default license: kratos/license.txt
10 //
11 // Main authors: Riccardo Rossi
12 // Vicente Mataix Ferrandiz
13 //
14 
15 #if !defined(KRATOS_GEOMETRY_TEST_H_INCLUDED )
16 #define KRATOS_GEOMETRY_TEST_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "containers/model.h"
25 
26 namespace Kratos
27 {
30 
34 
38 
42 
46 
50 
58 class KRATOS_API(KRATOS_CORE) GeometryTesterUtility
59 {
60 public:
63 
66 
68  typedef Node NodeType;
69 
72 
74 
78 
81 
83  virtual ~GeometryTesterUtility() {};
84 
88 
92 
98  bool RunTest(Model& rModel);
99 
105  bool TestTetrahedra3D4N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestTetrahedra3D4N(rModelPart, ss);}
106 
113  bool StreamTestTetrahedra3D4N(
114  ModelPart& rModelPart,
115  std::stringstream& rErrorMessage
116  );
117 
123  bool TestTetrahedra3D10N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestTetrahedra3D10N(rModelPart, ss);}
124 
131  bool StreamTestTetrahedra3D10N(
132  ModelPart& rModelPart,
133  std::stringstream& rErrorMessage
134  );
135 
141  bool TestTriangle2D3N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestTriangle2D3N(rModelPart, ss);}
142 
149  bool StreamTestTriangle2D3N(
150  ModelPart& rModelPart,
151  std::stringstream& rErrorMessage
152  );
153 
159  bool TestTriangle2D6N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestTriangle2D6N(rModelPart, ss);}
160 
167  bool StreamTestTriangle2D6N(
168  ModelPart& rModelPart,
169  std::stringstream& rErrorMessage
170  );
171 
177  bool TestQuadrilateral2D4N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestQuadrilateral2D4N(rModelPart, ss);}
178 
185  bool StreamTestQuadrilateral2D4N(
186  ModelPart& rModelPart,
187  std::stringstream& rErrorMessage
188  );
189 
195  bool TestQuadrilateral2D9N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestQuadrilateral2D9N(rModelPart, ss);}
196 
203  bool StreamTestQuadrilateral2D9N(
204  ModelPart& rModelPart,
205  std::stringstream& rErrorMessage
206  );
207 
213  bool TestQuadrilateralInterface2D4N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestQuadrilateralInterface2D4N(rModelPart, ss);}
214 
221  bool StreamTestQuadrilateralInterface2D4N(
222  ModelPart& rModelPart,
223  std::stringstream& rErrorMessage
224  );
225 
231  bool TestHexahedra3D8N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestHexahedra3D8N(rModelPart, ss);}
232 
239  bool StreamTestHexahedra3D8N(
240  ModelPart& rModelPart,
241  std::stringstream& rErrorMessage
242  );
243 
249  bool TestHexahedra3D20N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestHexahedra3D20N(rModelPart, ss);}
250 
257  bool StreamTestHexahedra3D20N(
258  ModelPart& rModelPart,
259  std::stringstream& rErrorMessage
260  );
261 
267  bool TestHexahedra3D27N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestHexahedra3D27N(rModelPart, ss);}
268 
275  bool StreamTestHexahedra3D27N(
276  ModelPart& rModelPart,
277  std::stringstream& rErrorMessage
278  );
279 
285  bool TestHexahedraInterface3D8N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestHexahedraInterface3D8N(rModelPart, ss);}
286 
293  bool StreamTestHexahedraInterface3D8N(
294  ModelPart& rModelPart,
295  std::stringstream& rErrorMessage
296  );
297 
303  bool TestPrism3D6N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestPrism3D6N(rModelPart, ss);}
304 
311  bool StreamTestPrism3D6N(
312  ModelPart& rModelPart,
313  std::stringstream& rErrorMessage
314  );
315 
321  bool TestPrism3D15N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestPrism3D15N(rModelPart, ss);}
322 
329  bool StreamTestPrism3D15N(
330  ModelPart& rModelPart,
331  std::stringstream& rErrorMessage
332  );
333 
339  bool TestPrismInterface3D6N(ModelPart& rModelPart) {std::stringstream ss; return StreamTestPrismInterface3D6N(rModelPart, ss);}
340 
347  bool StreamTestPrismInterface3D6N(
348  ModelPart& rModelPart,
349  std::stringstream& rErrorMessage
350  );
351 
355 
356 
360 
361 
365 
367  virtual std::string Info() const
368  {
369  std::stringstream buffer;
370  buffer << "GeometryTesterUtility" ;
371  return buffer.str();
372  }
373 
375  virtual void PrintInfo(std::ostream& rOStream) const
376  {
377  rOStream << "GeometryTesterUtility";
378  }
379 
381  virtual void PrintData(std::ostream& rOStream) const {}
382 
387 
388 protected:
389 
392 
396 
397 
401 
402 
406 
411  void GenerateNodes(ModelPart& rModelPart);
412 
416 
420 
424 
426 private:
429 
433 
437 
441 
449  bool VerifyAreaByIntegration(
450  GeometryType& rGeometry,
452  const double ReferanceArea,
453  std::stringstream& rErrorMessage
454  );
455 
463  void VerifyStrainExactness(
464  GeometryType& rGeometry,
466  std::stringstream& rErrorMessage
467  );
468 
476  void CalculateB(
477  Matrix& rB,
478  Matrix& rDN_DX,
479  const std::size_t NumberOfNodes,
480  const std::size_t Dimension
481  );
482 
491  bool VerifyIsInside(
492  GeometryType& rGeometry,
493  GeometryType::CoordinatesArrayType& rGlobalCoordinates,
494  const bool ExpectedResult,
495  std::stringstream& rErrorMessage
496  );
497 
505  bool VerfiyShapeFunctionsValues(
506  GeometryType& rGeometry,
507  GeometryType::CoordinatesArrayType& rGlobalCoordinates,
508  std::stringstream& rErrorMessage
509  );
510 
518  bool VerifyShapeFunctionsSecondDerivativesValues(
519  GeometryType& rGeometry,
520  GeometryType::CoordinatesArrayType& rGlobalCoordinates,
521  std::stringstream& rErrorMessage
522  ) const;
523 
530  bool VerifyShapeFunctionsSecondDerivativesInterpolation(
531  GeometryType& rGeometry,
532  std::stringstream& rErrorMessage
533  ) const;
534 
541  std::string GetIntegrationName(
542  GeometryType& rGeometry,
544  );
545 
551  std::string GetGeometryName(GeometryType& rGeometry);
552 
556 
560 
564 
566  GeometryTesterUtility& operator=(GeometryTesterUtility const& rOther) {return *this;}
567 
569  GeometryTesterUtility(GeometryTesterUtility const& rOther) {}
570 
572 
573 }; // Class GeometryTesterUtility
574 
576 
579 
580 
584 
585 
587 inline std::istream& operator >> (std::istream& rIStream,
588  GeometryTesterUtility& rThis) {
589  return rIStream;
590 }
591 
593 inline std::ostream& operator << (std::ostream& rOStream,
594  const GeometryTesterUtility& rThis)
595 {
596  rThis.PrintInfo(rOStream);
597  rOStream << std::endl;
598  rThis.PrintData(rOStream);
599 
600  return rOStream;
601 }
603 
605 
606 } // namespace Kratos.
607 
608 #endif // KRATOS_GEOMETRY_TEST_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
This utility tests the geometries.
Definition: geometry_tester.h:59
GeometryTesterUtility()
Default constructor.
Definition: geometry_tester.h:80
bool TestHexahedra3D20N(ModelPart &rModelPart)
This function tests the Hexahedra3D20N.
Definition: geometry_tester.h:249
bool TestPrism3D15N(ModelPart &rModelPart)
This function tests the Prism3D15N.
Definition: geometry_tester.h:321
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry_tester.h:381
Node NodeType
Node type.
Definition: geometry_tester.h:68
bool TestHexahedraInterface3D8N(ModelPart &rModelPart)
This function tests the Hexahedra3D8N (interface)
Definition: geometry_tester.h:285
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: geometry_tester.h:375
bool TestTetrahedra3D10N(ModelPart &rModelPart)
This function tests the Tetrahedra3D10N.
Definition: geometry_tester.h:123
bool TestQuadrilateral2D4N(ModelPart &rModelPart)
This function tests the Quadrilateral2D4N.
Definition: geometry_tester.h:177
Geometry< NodeType > GeometryType
Geometry type.
Definition: geometry_tester.h:71
bool TestPrismInterface3D6N(ModelPart &rModelPart)
This function tests the Prism3D6N (interface)
Definition: geometry_tester.h:339
virtual ~GeometryTesterUtility()
Destructor.
Definition: geometry_tester.h:83
virtual std::string Info() const
Turn back information as a string.
Definition: geometry_tester.h:367
bool TestHexahedra3D8N(ModelPart &rModelPart)
This function tests the Hexahedra3D8N.
Definition: geometry_tester.h:231
KRATOS_CLASS_POINTER_DEFINITION(GeometryTesterUtility)
Pointer definition of GeometryTesterUtility.
bool TestTriangle2D6N(ModelPart &rModelPart)
This function tests the Triangle2D6N.
Definition: geometry_tester.h:159
bool TestQuadrilateral2D9N(ModelPart &rModelPart)
This function tests the Quadrilateral2D9N.
Definition: geometry_tester.h:195
bool TestQuadrilateralInterface2D4N(ModelPart &rModelPart)
This function tests the Quadrilateral2D4N (interface)
Definition: geometry_tester.h:213
bool TestHexahedra3D27N(ModelPart &rModelPart)
This function tests the Hexahedra3D27N.
Definition: geometry_tester.h:267
bool TestTetrahedra3D4N(ModelPart &rModelPart)
This function tests the Tetrahedra3D4N.
Definition: geometry_tester.h:105
GeometryType::ShapeFunctionsSecondDerivativesType ShapeFunctionsSecondDerivativesType
Definition: geometry_tester.h:73
bool TestTriangle2D3N(ModelPart &rModelPart)
This function tests the Triangle2D3N.
Definition: geometry_tester.h:141
bool TestPrism3D6N(ModelPart &rModelPart)
This function tests the Prism3D6N.
Definition: geometry_tester.h:303
Definition: amatrix_interface.h:41
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Short class definition.
Definition: array_1d.h:61
void CalculateB(const GeometricalObject &rElement, const TMatrixType1 &rDN_DX, TMatrixType2 &rB)
This method computes the deformation tensor B (for small deformation solid elements)
Definition: structural_mechanics_element_utilities.h:105
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