57 for (
unsigned f = 0; f <
n_facet; ++f)
77 for (
unsigned f = 0; f <
n_facet; f++)
134 for (
unsigned e = 0;
e <
nel;
e++)
139 if (doc)
outfile <<
"Element: " <<
e <<
" " <<
fe_pt << std::endl;
148 for (
unsigned i = 0;
i < 4;
i++)
161 std::set<unsigned>
aux;
163 std::set_intersection(
168 std::insert_iterator<std::set<unsigned>>(
aux,
aux.begin()));
170 std::set_intersection(
175 std::insert_iterator<std::set<unsigned>>(
face[3],
face[3].begin()));
181 std::set<unsigned>
aux;
183 std::set_intersection(
188 std::insert_iterator<std::set<unsigned>>(
aux,
aux.begin()));
190 std::set_intersection(
195 std::insert_iterator<std::set<unsigned>>(
face[2],
face[2].begin()));
201 std::set<unsigned>
aux;
203 std::set_intersection(
208 std::insert_iterator<std::set<unsigned>>(
aux,
aux.begin()));
210 std::set_intersection(
215 std::insert_iterator<std::set<unsigned>>(
face[1],
face[1].begin()));
221 std::set<unsigned>
aux;
223 std::set_intersection(
228 std::insert_iterator<std::set<unsigned>>(
aux,
aux.begin()));
230 std::set_intersection(
235 std::insert_iterator<std::set<unsigned>>(
face[0],
face[0].begin()));
240 for (
unsigned i = 0;
i < 4;
i++)
266 error_stream <<
"Your mesh may be too coarse or your tet mesh\n";
267 error_stream <<
"may be screwed up. I'm skipping the automated\n";
268 error_stream <<
"setup of the elements next to the boundaries\n";
301 for (
unsigned i = 0;
i < 4;
i++)
349 outfile <<
"Boundary: " <<
i <<
" is adjacent to " <<
nel <<
" elements"
353 for (
unsigned e = 0;
e <
nel;
e++)
357 <<
" Face index of boundary is "
376 for (
unsigned e = 0;
e < 6;
e++)
381 for (
unsigned e = 0;
e < nel;
e++)
384 for (
unsigned i = 0;
i < 3;
i++)
395 for (
unsigned j = 0;
j < 6;
j++)
398 for (
unsigned i = 0;
i < 3;
i++)
408 for (
unsigned j = 0;
j < 4;
j++)
464 some_file <<
"ZONE N=4, E=1, F=FEPOINT, ET=TETRAHEDRON\n";
465 for (
unsigned j = 0;
j < 4;
j++)
467 for (
unsigned i = 0;
i < 3;
i++)
489 for (
unsigned j = 0;
j <
nnod;
j++)
499 for (
unsigned b = 0; b <
n_bound; b++)
505 reason <<
"Can't snap nodes on boundary " << b
506 <<
" onto geom object because: \n";
509 std::map<unsigned, TetMeshFacetedSurface*>::iterator
it =
519 reason <<
"-- no facets asssociated with boundary\n";
530 reason <<
"-- no geom object associated with boundary\n";
538 reason <<
"-- facet has to be triangular and vertex coordinates have\n"
539 <<
" to have been set up\n";
546 reason <<
"-- no boundary coordinates were set up\n";
557 for (
unsigned f = 0; f <
nf; f++)
569 unsigned nv =
f_pt->nvertex();
572 reason <<
"-- number of facet vertices is " <<
nv
573 <<
" rather than 3\n";
578 if ((
f_pt->vertex_pt(0)->zeta_in_geom_object().
size() != 2) ||
579 (
f_pt->vertex_pt(1)->zeta_in_geom_object().
size() != 2) ||
580 (
f_pt->vertex_pt(2)->zeta_in_geom_object().
size() != 2))
582 reason <<
"-- no boundary coordinates were set up\n";
632 double s2 = 1.0 -
s0 -
s1;
639 zeta_0 =
f_pt->vertex_pt(0)->zeta_in_geom_object();
642 zeta_1 =
f_pt->vertex_pt(1)->zeta_in_geom_object();
645 zeta_2 =
f_pt->vertex_pt(2)->zeta_in_geom_object();
652 double tol = 1.0e-12;
655 for (
unsigned v = 0;
v < 3;
v++)
710 std::ostringstream error_message;
712 <<
"Error in parametrisation of boundary coordinates \n"
713 <<
"for vertex " <<
v <<
" [alt=" <<
alt <<
"] in facet "
757 1 +
nod_pt->position_time_stepper_pt()->nprev_values();
764 for (
unsigned i = 0;
i < 3;
i++)
777 for (
unsigned e = 0;
e <
nel;
e++)
795 for (
unsigned j = 0;
j <
nnod;
j++)
802 for (
unsigned i = 0;
i < 3;
i++)
815 for (
unsigned j = 0;
j <
nnod;
j++)
818 for (
unsigned i = 0;
i < 3;
i++)
830 std::ostringstream error_message;
832 <<
"A number of elements, namely: " <<
count
833 <<
" are inverted after snapping. Their shapes are in "
834 <<
" overly_distorted_element*.dat and "
835 "orig_overly_distorted_element*.dat"
836 <<
"Next person to get this error: Please implement a straightforward\n"
837 <<
"variant of one of the functors in src/mesh_smoothing to switch\n"
838 <<
"to harmonic mapping\n"
845 oomph_info <<
"No elements are inverted after snapping. Yay!"
A general Finite Element class.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void check_J_eulerian_at_knots(bool &passed) const
Check that Jacobian of mapping between local and Eulerian coordinates at all integration points is po...
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
/////////////////////////////////////////////////////////////////////
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Vector< Vector< FiniteElement * > > Boundary_element_pt
Vector of Vector of pointers to elements on the boundaries: Boundary_element_pt(b,...
bool Lookup_for_elements_next_boundary_is_setup
Flag to indicate that the lookup schemes for elements that are adjacent to the boundaries has been se...
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Vector< Vector< int > > Face_index_at_boundary
For the e-th finite element on boundary b, this is the index of the face that lies along that boundar...
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
unsigned nboundary() const
Return number of boundaries.
unsigned long nnode() const
Return number of nodes in the mesh.
unsigned long nelement() const
Return number of elements in the mesh.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Return a pointer to set of mesh boundaries that this node occupies; this will be overloaded by Bounda...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
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 output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
void snap_nodes_onto_geometric_objects()
Move the nodes on boundaries with associated GeomObjects so that they exactly coincide with the geome...
std::map< unsigned, TetMeshFacetedSurface * > Tet_mesh_faceted_surface_pt
Reverse lookup scheme: Pointer to faceted surface (if any!) associated with boundary b.
static double Tolerance_for_boundary_finding
Global static data that specifies the permitted error in the setup of the boundary coordinates.
void assess_mesh_quality(std::ofstream &some_file)
Assess mesh quality: Ratio of max. edge length to min. height, so if it's very large it's BAAAAAD.
void setup_boundary_element_info()
Setup lookup schemes which establish which elements are located next to mesh's boundaries (wrapper to...
std::map< unsigned, Vector< Vector< double > > > Triangular_facet_vertex_boundary_coordinate
Boundary coordinates of vertices in triangular facets associated with given boundary....
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
virtual ~TetMeshFacetedClosedSurfaceForRemesh()
Destructor. Delete allocated memory.
TetMeshFacetedClosedSurfaceForRemesh(Vector< Node * > const &vertex_node_pt, Vector< Vector< unsigned > > const &facet_connectivity, Vector< unsigned > const &facet_boundary_id)
Constructor for a FacetedSurface created from a list of nodes and connectivity information....
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
Vector< TetMeshVertex * > Vertex_pt
Vector pointers to vertices.
unsigned nfacet() const
Number of facets.
Vector< TetMeshFacet * > Facet_pt
Vector of pointers to facets.
unsigned nvertex() const
Number of vertices.
Vertex for Tet mesh generation. Can lie on multiple boundaries (identified via one-based enumeration!...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...