27#ifndef OOMPH_TETGEN_MESH_HEADER
28#define OOMPH_TETGEN_MESH_HEADER
32#include <oomph-lib-config.h>
41#include "../generic/tetgen_scaffold_mesh.h"
42#include "../generic/tet_mesh.h"
50 template<
class ELEMENT>
58 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
70 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
91 for (
unsigned b = 0;
b <
nb;
b++)
106 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
130 for (
unsigned b = 0;
b <
nb;
b++)
156 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
187 for (
unsigned b = 0;
b <
nb;
b++)
210 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
240 for (
unsigned b = 0;
b <
nb;
b++)
256 const double& element_volume,
263 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
272 Outer_boundary_pt = outer_boundary_pt;
276 Internal_surface_pt = internal_surface_pt;
279 unsigned n = this->Internal_surface_pt.size();
280 for (
unsigned i = 0;
i <
n;
i++)
283 Internal_surface_pt[
i]);
315 outer_boundary_pt->boundaries_can_be_split_in_tetgen();
317 unsigned n_internal = internal_surface_pt.size();
321 internal_surface_pt[
i]->boundaries_can_be_split_in_tetgen();
347 unsigned n_internal = internal_surface_pt.size();
358 srf_pt->internal_point_identifies_region_for_tetgen(
j);
385 for (
unsigned b = 0;
b <
nb;
b++)
406 tetgenio::polygon*
p;
414 const unsigned n_internal = internal_surface_pt.size();
436 for (
unsigned i = 0;
i < 3; ++
i)
439 outer_boundary_pt->vertex_coordinate(
n,
i);
448 for (
unsigned i = 0;
i < 3; ++
i)
451 internal_surface_pt[
h]->vertex_coordinate(
n,
i);
463 outer_boundary_pt->one_based_vertex_boundary_id(
n);
472 internal_surface_pt[
h]->one_based_vertex_boundary_id(
n);
497 f->numberofpolygons = 1;
498 f->polygonlist =
new tetgenio::polygon[
f->numberofpolygons];
499 f->numberofholes = 0;
501 p = &
f->polygonlist[0];
505 p->numberofvertices =
facet.size();
506 p->vertexlist =
new int[
p->numberofvertices];
507 for (
int i = 0;
i <
p->numberofvertices; ++
i)
515 outer_boundary_pt->one_based_facet_boundary_id(
n);
532 f->numberofpolygons = 1;
533 f->polygonlist =
new tetgenio::polygon[
f->numberofpolygons];
534 f->numberofholes = 0;
536 p = &
f->polygonlist[0];
539 internal_surface_pt[
h]->vertex_index_in_tetgen(
n);
541 p->numberofvertices =
facet.size();
542 p->vertexlist =
new int[
p->numberofvertices];
543 for (
int i = 0;
i <
p->numberofvertices; ++
i)
550 internal_surface_pt[
h]->one_based_facet_boundary_id(
n);
562 if (
srf_pt->internal_point_identifies_hole_for_tetgen(
j))
569 if (
srf_pt->internal_point_identifies_region_for_tetgen(
j))
592 if (
srf_pt->internal_point_identifies_hole_for_tetgen(
j))
594 for (
unsigned i = 0;
i < 3; ++
i)
597 srf_pt->internal_point_for_tetgen(
j,
i);
619 if (
srf_pt->internal_point_identifies_region_for_tetgen(
j))
621 for (
unsigned i = 0;
i < 3; ++
i)
624 srf_pt->internal_point_for_tetgen(
j,
i);
628 static_cast<double>(
srf_pt->region_id_for_tetgen(
j));
738 template<
class ELEMENT>
740 public virtual SolidMesh
785 for (
unsigned b = 0;
b <
nb;
b++)
Quadrilateral mesh generator; Uses input from Geompack++. See: http://members.shaw....
/////////////////////////////////////////////////////////////// /////////////////////////////////////...
SolidTetgenMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &face_file_name, const bool &split_corner_elements, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor. Boundary coordinates are setup automatically.
SolidTetgenMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &face_file_name, const bool &split_corner_elements, const bool &switch_normal, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor. Boundary coordinates are re-setup automatically, with the orientation of the outer unit ...
virtual ~SolidTetgenMesh()
Empty Destructor.
Unstructured tet mesh based on output from Tetgen: http://wias-berlin.de/software/tetgen/.
TetgenMesh(tetgenio &tetgen_data, const bool &split_corner_elements, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor with tetgen data structure Setting the boolean flag to true splits "corner" elements,...
TetgenMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &face_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor with the input files.
TetgenMesh()
Empty constructor.
void build_from_scaffold(TimeStepper *time_stepper_pt, const bool &use_attributes)
Build mesh from scaffold.
tetgenio *& tetgenio_pt()
Access to the triangulateio representation of the mesh.
tetgenio * Tetgenio_pt
Tetgen representation of mesh.
TetgenMesh(TetMeshFacetedClosedSurface *const &outer_boundary_pt, Vector< TetMeshFacetedSurface * > &internal_surface_pt, const double &element_volume, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false, const bool &split_corner_elements=false, Vector< double > *const &target_element_volume_in_region_pt=nullptr)
Build mesh, based on a TetgenMeshFactedClosedSurface that specifies the outer boundary of the domain ...
void setup_reverse_lookup_schemes_for_faceted_surface(TetMeshFacetedSurface *const &faceted_surface_pt)
Function to setup the reverse look-up schemes.
TetgenMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &face_file_name, const bool &split_corner_elements, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor with the input files. Setting the boolean flag to true splits "corner" elements,...
void set_deep_copy_tetgenio_pt(tetgenio *const &tetgenio_pt)
Set the tetgen pointer by a deep copy.
void deep_copy_of_tetgenio(tetgenio *const &input_pt, tetgenio *&output_pt)
Transfer tetgenio data from the input to the output The output is assumed to have been constructed an...
bool Use_attributes
Boolean flag to indicate whether to use attributes or not (required for multidomain meshes)
~TetgenMesh()
Empty destructor.
void set_mesh_level_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Overload set_mesh_level_time_stepper so that the stored time stepper now corresponds to the new times...
void build_tetgenio(TetMeshFacetedSurface *const &outer_boundary_pt, Vector< TetMeshFacetedSurface * > &internal_surface_pt, Vector< double > *const &target_element_volume_in_region_pt, tetgenio &tetgen_io)
Build tetgenio object from the TetMeshFacetedSurfaces.
bool Tetgenio_exists
Boolean to indicate whether a tetgenio representation of the mesh exists.
TetgenScaffoldMesh * Tmp_mesh_pt
Temporary scaffold mesh.
TetgenMesh(tetgenio &tetgen_data, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false)
Constructor with tetgenio data structure.
bool tetgenio_exists() const
Boolen defining whether tetgenio object has been built or not.
////////////////////////////////////////////////////////////////////// //////////////////////////////...