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.
Classes | List of all members
Kratos::EdgeSwapping2DModeler Class Reference

Optimizes a 2D mesh by swapping the edges between elements. More...

#include <edge_swapping_2d_modeler.h>

Inheritance diagram for Kratos::EdgeSwapping2DModeler:
Collaboration diagram for Kratos::EdgeSwapping2DModeler:

Public Member Functions

Life Cycle
 EdgeSwapping2DModeler ()
 Empty default constructor. More...
 
virtual ~EdgeSwapping2DModeler ()
 Empty destructor. More...
 
Operations
void Remesh (ModelPart &rThisModelPart)
 
void WriteMesh (ModelPart &rThisModelPart, const std::string &Filename)
 
Input and output
virtual std::string Info () const override
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const override
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const override
 Print object's data. More...
 
- Public Member Functions inherited from Kratos::Modeler
 Modeler (Parameters ModelerParameters=Parameters())
 Default constructor. More...
 
 Modeler (Model &rModel, Parameters ModelerParameters=Parameters())
 Constructor with Model. More...
 
virtual ~Modeler ()=default
 Destructor. More...
 
virtual Modeler::Pointer Create (Model &rModel, const Parameters ModelParameters) const
 Creates the Modeler Pointer. More...
 
virtual void SetupGeometryModel ()
 Import or generate geometry models from external input. More...
 
virtual void PrepareGeometryModel ()
 Prepare or update the geometry model_part. More...
 
virtual void SetupModelPart ()
 Convert the geometry model or import analysis suitable models. More...
 
virtual const Parameters GetDefaultParameters () const
 This method provides the defaults parameters to avoid conflicts between the different constructors. More...
 
virtual void GenerateModelPart (ModelPart &rOriginModelPart, ModelPart &rDestinationModelPart, Element const &rReferenceElement, Condition const &rReferenceBoundaryCondition)
 
virtual void GenerateMesh (ModelPart &ThisModelPart, Element const &rReferenceElement, Condition const &rReferenceBoundaryCondition)
 
virtual void GenerateNodes (ModelPart &ThisModelPart)
 
 KRATOS_CLASS_POINTER_DEFINITION (Modeler)
 Pointer definition of Modeler. More...
 

Type Definitions

typedef Modeler BaseType
 
typedef Point PointType
 
typedef Node NodeType
 
typedef Geometry< NodeTypeGeometryType
 
typedef PointerVector< NodeTypeNodesVectorType
 
typedef std::size_t SizeType
 
 KRATOS_CLASS_POINTER_DEFINITION (EdgeSwapping2DModeler)
 Pointer definition of EdgeSwapping2DModeler. More...
 

Additional Inherited Members

- Public Types inherited from Kratos::Modeler
typedef std::size_t SizeType
 
typedef std::size_t IndexType
 
- Protected Attributes inherited from Kratos::Modeler
Parameters mParameters
 
SizeType mEchoLevel
 

Detailed Description

Optimizes a 2D mesh by swapping the edges between elements.

This class can be used to optimized a 2D mesh modifying the connectivities of the elements. This modeler also collapses the nodes which are marked to be deleted. Nodes must be marked by setting the TO_ERASE in data value container (using Node::SetValue) to true. The algorithm consist of doing iteration over following steps:

See also
Remesh

Member Typedef Documentation

◆ BaseType

Definition of the Modeler class as BaseType of EdgeSwapping2DModeler

◆ GeometryType

Defining Geometry of 3D Node class as geometry type

◆ NodesVectorType

A PointerVector of 3D Node class as array of nodes.

◆ NodeType

Defining 3D Node class as nodes of the mesh

◆ PointType

◆ SizeType

Constructor & Destructor Documentation

◆ EdgeSwapping2DModeler()

Kratos::EdgeSwapping2DModeler::EdgeSwapping2DModeler ( )
inline

Empty default constructor.

◆ ~EdgeSwapping2DModeler()

virtual Kratos::EdgeSwapping2DModeler::~EdgeSwapping2DModeler ( )
inlinevirtual

Empty destructor.

Member Function Documentation

◆ Info()

virtual std::string Kratos::EdgeSwapping2DModeler::Info ( ) const
inlineoverridevirtual

Turn back information as a string.

Reimplemented from Kratos::Modeler.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::EdgeSwapping2DModeler::KRATOS_CLASS_POINTER_DEFINITION ( EdgeSwapping2DModeler  )

Pointer definition of EdgeSwapping2DModeler.

◆ PrintData()

virtual void Kratos::EdgeSwapping2DModeler::PrintData ( std::ostream &  rOStream) const
inlineoverridevirtual

Print object's data.

Reimplemented from Kratos::Modeler.

◆ PrintInfo()

virtual void Kratos::EdgeSwapping2DModeler::PrintInfo ( std::ostream &  rOStream) const
inlineoverridevirtual

Print information about this object.

Reimplemented from Kratos::Modeler.

◆ Remesh()

void Kratos::EdgeSwapping2DModeler::Remesh ( ModelPart rThisModelPart)
inline

Remesh is the main method of this class and perform all the swapping and collapsing process. It accepts a ModelPart as its inputs and performs the remeshing process over its current mesh. The iterative process of finding pair of swapping elements and swap them is limited to maximum_repeat_number which is set to 10.

Parameters
rThisModelPartThe model part containing the mesh to be remeshed

◆ WriteMesh()

void Kratos::EdgeSwapping2DModeler::WriteMesh ( ModelPart rThisModelPart,
const std::string &  Filename 
)
inline

An auxiliary method for writing the mesh for GiD for debugging purpose


The documentation for this class was generated from the following file: