27#ifndef OOMPH_QUAD_FROM_TRIANGLE_MESH_HEADER
28#define OOMPH_QUAD_FROM_TRIANGLE_MESH_HEADER
43#ifdef OOMPH_HAS_FPUCONTROLH
44#include <fpu_control.h>
48#include "generic/problem.h"
49#include "generic/quad_mesh.h"
51#include "generic/triangle_scaffold_mesh.h"
52#include "generic/unstructured_two_d_mesh_geometry_base.h"
53#include "generic/refineable_quad_mesh.h"
54#include "generic/Qelements.h"
69 template<
class ELEMENT>
71 public virtual QuadMeshBase
77#ifdef OOMPH_HAS_TRIANGLE_LIB
80 this->Allow_automatic_creation_of_vertices_on_boundaries =
true;
84 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
97 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
100 this->Allow_automatic_creation_of_vertices_on_boundaries =
128#ifdef OOMPH_HAS_TRIANGLE_LIB
138 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
141 this->Allow_automatic_creation_of_vertices_on_boundaries =
143 .is_automatic_creation_of_vertices_on_boundaries_allowed();
169 if (outer_boundary_pt.size() == 0)
173 <<
"There are no outer boundaries defined.\n"
174 <<
"Verify that you have specified the outer boundaries in the\n"
175 <<
"Triangle_mesh_parameter object\n\n";
263 outer_boundary_pt[
i]);
272 internal_closed_curve_pt[
i]);
297 std::map<unsigned, Vector<double>>
regions =
303 const bool refine_boundary =
313 <<
"You have specified that Triangle may refine the outer boundary, "
315 <<
"not internal boundaries. Triangle does not support this "
317 <<
"If you do not want Triangle to refine internal boundaries, it "
319 <<
"refine outer boundaries either!\n"
320 <<
"Please either disable all boundary refinement\n"
321 <<
"(call TriangleMeshParameters::disable_boundary_refinement()\n"
322 <<
"or enable internal boundary refinement (the default)\n";
330 outer_boundary_polygon_pt,
334 extra_holes_coordinates,
356 for (
unsigned b = 0;
b <
nb;
b++)
372 const double& element_area,
378 const bool& refine_boundary,
383 if (element_area < 10
e-14)
387 <<
"The current elements area was stated to (" << element_area
388 <<
").\nThe current precision to generate the input to triangle "
389 <<
"is fixed to 14 digits\n\n";
404 this->Outer_boundary_pt = outer_boundary_pt;
413 this->Extra_holes_coordinates = extra_holes_coordinates;
416 this->Regions_coordinates = regions_coordinates;
427 UnstructuredTwoDMeshGeometryBase::build_triangulateio(
431 extra_holes_coordinates,
452 if (!this->is_automatic_creation_of_vertices_on_boundaries_allowed())
458 if (refine_boundary ==
false)
479#ifdef OOMPH_HAS_FPUCONTROLH
490 if (!regions_coordinates.empty())
526#ifdef OOMPH_HAS_TRIANGLE_LIB
528 std::set<TriangleMeshCurveSection*>::iterator
it_polyline;
533 delete (*it_polyline);
536 std::set<TriangleMeshPolygon*>::iterator
it_polygon;
541 delete (*it_polygon);
549 delete (*it_open_polyline);
577 template<
class ELEMENT>
583#ifdef OOMPH_HAS_TRIANGLE_LIB
648 template<
class ELEMENT>
651 public virtual SolidMesh
670#ifdef OOMPH_HAS_TRIANGLE_LIB
699 template<
class ELEMENT>
702 public virtual SolidMesh
723#ifdef OOMPH_HAS_TRIANGLE_LIB
Quad mesh built on top of triangle scaffold mesh coming from the triangle mesh generator Triangle....
TimeStepper * Time_stepper_pt
Timestepper used to build elements.
QuadFromTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameters. All the actual work is done in Uns...
void operator=(const QuadFromTriangleMesh &)=delete
Broken assignment operator.
~QuadFromTriangleMesh()
Empty destructor.
QuadFromTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false, const bool &allow_automatic_creation_of_vertices_on_boundaries=true)
Constructor with the input files.
bool Use_attributes
Boolean flag to indicate whether to use attributes or not (required for multidomain meshes)
void generic_constructor(Vector< TriangleMeshPolygon * > &outer_boundary_pt, Vector< TriangleMeshPolygon * > &internal_polygon_pt, Vector< TriangleMeshOpenCurve * > &open_polylines_pt, const double &element_area, Vector< Vector< double > > &extra_holes_coordinates, std::map< unsigned, Vector< double > > ®ions_coordinates, std::map< unsigned, double > ®ions_areas, TimeStepper *time_stepper_pt, const bool &use_attributes, const bool &refine_boundary, const bool &refine_internal_boundary)
A general-purpose construction function that builds the mesh once the different specific constructors...
void build_from_scaffold(TriangleScaffoldMesh *tmp_mesh_pt, TimeStepper *time_stepper_pt, const bool &use_attributes)
Build the quad mesh from the given scaffold mesh.
QuadFromTriangleMesh(const QuadFromTriangleMesh &dummy)=delete
Broken copy constructor.
QuadFromTriangleMesh()
Empty constructor.
Unstructured refineable QuadFromTriangleMesh.
virtual void refine_uniformly()
Refine mesh uniformly.
RefineableQuadFromTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameters.
RefineableQuadFromTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the polyfiles.
virtual ~RefineableQuadFromTriangleMesh()
Empty Destructor.
void refine_uniformly(DocInfo &doc_info)
Refine mesh uniformly and doc process.
Unstructured refineable QuadFromTriangleMesh upgraded to solid mesh.
virtual ~RefineableSolidQuadFromTriangleMesh()
Empty Destructor.
RefineableSolidQuadFromTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameter.
RefineableSolidQuadFromTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Build mesh from specified triangulation and associated target areas for elements in it.
Unstructured refineable Triangle Mesh.
Unstructured QuadFromTriangleMesh upgraded to solid mesh.
SolidQuadFromTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on closed curve that specifies the outer boundary of the domain and any number of i...
SolidQuadFromTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
virtual ~SolidQuadFromTriangleMesh()
Empty Destructor.
Helper object for dealing with the parameters used for the TriangleMesh objects.
void triangulate(char *triswitches, struct oomph::TriangulateIO *in, struct oomph::TriangulateIO *out, struct oomph::TriangulateIO *vorout)