27#ifndef OOMPH_REFINEABLE_TETGEN_MESH_TEMPLATE_HEADER
28#define OOMPH_REFINEABLE_TETGEN_MESH_TEMPLATE_HEADER
30#ifndef OOMPH_REFINEABLE_TETGEN_MESH_HEADER
31#error __FILE__ should only be included from refineable_tetgen_mesh.h.
36#include <oomph-lib-config.h>
51 template<
class ELEMENT>
92 el_pt->set_boundary_number_in_bulk_mesh(
bound);
188 for (
unsigned f = 0; f <
n_facet; f++)
190 for (
unsigned i = 0;
i < 3;
i++)
210 for (
unsigned i = 0;
i < 3;
i++)
216 for (
unsigned i = 0;
i < 3;
i++)
229 template<
class ELEMENT>
233 unsigned n_hole = this->Internal_surface_pt.
size();
241 this->update_faceted_surface_using_face_mesh(
242 this->Internal_surface_pt[
ihole]);
248 template<
class ELEMENT>
253 if (!boundary_coordinate_exists(b))
255 oomph_info <<
"Not snapping nodes on boundary " << b
256 <<
" because no boundary coordinate has been set up.\n";
289 el_pt->set_boundary_number_in_bulk_mesh(b);
300 filestring <<
"old_mesh_boundary" << b <<
".dat";
303 filestring <<
"new_mesh_boundary" << b <<
".dat";
307 std::cout <<
"OLD---\n";
309 unsigned n_tmp_node = this->nboundary_node(b);
315 <<
" " <<
b_coo[0] <<
" " <<
b_coo[1] <<
"\n";
318 std::cout <<
"NEW-----------\n";
326 <<
" " <<
b_coo[0] <<
" " <<
b_coo[1] <<
"\n";
347 for (
unsigned i = 0;
i < 3;
i++)
369 for (
unsigned n = 0;
n < 4;
n++)
373 for (
unsigned n = 0;
n < 10;
n++)
381 dynamic_cast<ELEMENT*
>(
new_mesh_pt->boundary_element_pt(b,
e));
389 for (
unsigned n = 0;
n < 4;
n++)
391 for (
unsigned i = 0;
i < 3;
i++)
399 for (
unsigned n = 4;
n < 10;
n++)
407 for (
unsigned i = 0;
i < 3;
i++)
419 for (
unsigned n = 0;
n < 10;
n++)
421 for (
unsigned i = 0;
i < 3;
i++)
437 for (
unsigned i = 0;
i < 3;
i++)
452 template<
class ELEMENT>
468 for (
unsigned e = 0;
e <
n;
e++)
476 oomph_info <<
"Number of elements to be refined " << this->Nrefined
478 oomph_info <<
"Number of elements to be unrefined " << this->Nunrefined
489 <<
"adapt: Time for getting volume targets : "
502 if ((Nrefined > 0) || (Nunrefined > this->max_keep_unrefined()) ||
505 if (!((Nrefined > 0) || (Nunrefined > max_keep_unrefined())))
507 oomph_info <<
"Mesh regeneration triggered by edge ratio criterion\n";
524 throw OomphLibError(
"Solid RefineableTetgenMesh not done yet.",
537 this->Outer_boundary_pt,
538 this->Internal_surface_pt,
540 this->Time_stepper_pt,
541 this->Use_attributes,
542 this->Corner_elements_must_be_split);
547 <<
"adapt: Time for building temp mesh : "
569 cgal_params.enable_use_eulerian_coordinates_during_setup();
575 std::ostringstream error_message;
576 error_message <<
"Non-CGAL-based target size transfer not implemented.\n";
599 unsigned nelem = this->nelement();
600 for (
unsigned e = 0;
e <
nelem;
e++)
623 for (
unsigned e = 0;
e <
nelem;
e++)
632 for (
unsigned i = 0;
i < 3;
i++)
652 std::stringstream error_message;
653 error_message <<
"Limited locate zeta failed for zeta = [ "
654 << x[0] <<
" " << x[1] <<
" " << x[2]
655 <<
" ]. Makes no sense!\n";
667 std::stringstream error_message;
668 error_message <<
"Cast to FE for GeomObject returned by "
669 "limited locate zeta failed for zeta = [ "
670 << x[0] <<
" " << x[1] <<
" " << x[2]
671 <<
" ]. Makes no sense!\n";
705 std::ostringstream error_message;
707 <<
"Non-CGAL-based target size transfer not implemented.\n";
762 for (
unsigned u = 0; u <
length; u++)
803 <<
"This shouldn't happen! Element whose centroid is at "
816 <<
" has no target size assigned\n";
844 for (
unsigned j = 0;
j < 4;
j++)
890 <<
"All size adjustments accommodated by max. permitted size"
891 <<
" reduction during iter " <<
iter <<
"\n";
895 oomph_info <<
"NOT all size adjustments accommodated by max. "
896 <<
"permitted size reduction during iter " <<
iter
901 <<
"\n\n\n==================================================\n"
902 <<
"==================================================\n"
903 <<
"==================================================\n"
904 <<
"==================================================\n"
909 <<
"adapt: Time for new_target_size[.] : "
927 std::ostringstream error_message;
928 error_message <<
"RefineableSolidTetgenMesh not implemented yet.\n";
944 this->Outer_boundary_pt,
945 this->Internal_surface_pt,
946 this->Time_stepper_pt,
947 this->Use_attributes);
952 <<
"adapt: Time for new_mesh_pt : "
970 for (
unsigned j = 0;
j <
nnod;
j++)
973 for (
unsigned i = 0;
i < 3;
i++)
1008 if (!Projection_is_disabled)
1028 <<
"adapt: Time for project soln onto new mesh : "
1042 for (
unsigned j =
nnod;
j > 0;
j--)
1047 unsigned nel = nelement();
1048 for (
unsigned e =
nel;
e > 0;
e--)
1050 delete Element_pt[
e - 1];
1051 Element_pt[
e - 1] = 0;
1059 Element_pt.resize(
nel);
1060 for (
unsigned j = 0;
j <
nnod;
j++)
1064 for (
unsigned e = 0;
e <
nel;
e++)
1071 Boundary_element_pt.resize(
nbound);
1072 Face_index_at_boundary.resize(
nbound);
1073 Boundary_node_pt.resize(
nbound);
1074 for (
unsigned b = 0; b <
nbound; b++)
1077 Boundary_element_pt[b].resize(
nel);
1078 Face_index_at_boundary[b].resize(
nel);
1079 for (
unsigned e = 0;
e <
nel;
e++)
1081 Boundary_element_pt[b][
e] =
new_mesh_pt->boundary_element_pt(b,
e);
1082 Face_index_at_boundary[b][
e] =
1086 Boundary_node_pt[b].resize(
nnod);
1087 for (
unsigned j = 0;
j <
nnod;
j++)
1089 Boundary_node_pt[b][
j] =
new_mesh_pt->boundary_node_pt(b,
j);
1100 this->Region_element_pt.resize(
n_region);
1101 this->Region_attribute.resize(
n_region);
1105 this->Region_attribute[
i] =
new_mesh_pt->region_attribute(
i);
1108 unsigned r = this->Region_attribute[
i];
1113 this->Region_element_pt[
i][
e] =
1119 this->Boundary_region_element_pt.resize(
nbound);
1120 this->Face_index_region_at_boundary.resize(
nbound);
1123 for (
unsigned b = 0; b <
nbound; ++b)
1128 unsigned r = this->Region_attribute[
i];
1135 this->Boundary_region_element_pt[b][
r].resize(
1137 this->Face_index_region_at_boundary[b][
r].resize(
1143 this->Boundary_region_element_pt[b][
r][
e] =
1145 this->Face_index_region_at_boundary[b][
r][
e] =
1155 this->set_deep_copy_tetgenio_pt(
new_mesh_pt->tetgenio_pt());
1165 <<
"adapt: Time for moving nodes etc. to actual mesh : "
1173 std::stringstream error_message;
1175 <<
"Lagrangian coordinates are currently not projected but are\n"
1176 <<
"are re-set during adaptation. This is not appropriate for\n"
1177 <<
"real solid mechanics problems!\n";
1183 dynamic_cast<SolidMesh*
>(
this)->set_lagrangian_nodal_coordinates();
1194 oomph_info <<
"Not enough benefit in adaptation.\n";
CGAL-based SamplePointContainer.
Helper object for dealing with the parameters used for the CGALSamplePointContainer objects.
A general Finite Element class.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual)
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned nnode() const
Return the number of nodes.
Node ** Node_pt
Storage for pointers to the nodes in the element.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
A geometric object is an object that provides a parametrised description of its shape via the functio...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
This class provides a GeomObject representation of a given finite element mesh. The Lagrangian coordi...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
void resize(const unsigned &n_value)
Resize the number of equations.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
void surface_remesh_for_inner_hole_boundaries()
Generate a new faceted representation of the inner hole boundaries.
void update_faceted_surface_using_face_mesh(TetMeshFacetedSurface *&faceted_surface_pt)
Helper function that updates the input faceted surface by using the flattened elements from FaceMesh(...
void snap_nodes_onto_boundary(RefineableTetgenMesh< ELEMENT > *&new_mesh_pt, const unsigned &b)
Snap the boundary nodes onto any curvilinear boundaries.
void adapt(const Vector< double > &elem_error)
Adapt mesh, based on elemental error provided.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
Base class for closed tet mesh boundary bounded by polygonal planar facets.
Base class for tet mesh boundary defined by polygonal planar facets.
void setup()
Setup terminate helper.
double timer()
returns the time in seconds after some point in past
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...