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 "
384 for (
unsigned b = 0; b <
nbound; b++)
388 for (
unsigned e = 0;
e <
nel;
e++)
455 this->Element_pt.end())
531 for (
unsigned e = 0;
e < 6;
e++)
536 for (
unsigned e = 0;
e < nel;
e++)
539 for (
unsigned i = 0;
i < 3;
i++)
550 for (
unsigned j = 0;
j < 6;
j++)
553 for (
unsigned i = 0;
i < 3;
i++)
563 for (
unsigned j = 0;
j < 4;
j++)
619 some_file <<
"ZONE N=4, E=1, F=FEPOINT, ET=TETRAHEDRON\n";
620 for (
unsigned j = 0;
j < 4;
j++)
622 for (
unsigned i = 0;
i < 3;
i++)
644 for (
unsigned j = 0;
j <
nnod;
j++)
654 for (
unsigned b = 0; b <
n_bound; b++)
660 reason <<
"Can't snap nodes on boundary " << b
661 <<
" onto geom object because: \n";
664 std::map<unsigned, TetMeshFacetedSurface*>::iterator
it =
674 reason <<
"-- no facets asssociated with boundary\n";
685 reason <<
"-- no geom object associated with boundary\n";
693 reason <<
"-- facet has to be triangular and vertex coordinates have\n"
694 <<
" to have been set up\n";
701 reason <<
"-- no boundary coordinates were set up\n";
712 for (
unsigned f = 0; f <
nf; f++)
724 unsigned nv =
f_pt->nvertex();
727 reason <<
"-- number of facet vertices is " <<
nv
728 <<
" rather than 3\n";
733 if ((
f_pt->vertex_pt(0)->zeta_in_geom_object().
size() != 2) ||
734 (
f_pt->vertex_pt(1)->zeta_in_geom_object().
size() != 2) ||
735 (
f_pt->vertex_pt(2)->zeta_in_geom_object().
size() != 2))
737 reason <<
"-- no boundary coordinates were set up\n";
787 double s2 = 1.0 -
s0 -
s1;
794 zeta_0 =
f_pt->vertex_pt(0)->zeta_in_geom_object();
797 zeta_1 =
f_pt->vertex_pt(1)->zeta_in_geom_object();
800 zeta_2 =
f_pt->vertex_pt(2)->zeta_in_geom_object();
807 double tol = 1.0e-12;
810 for (
unsigned v = 0;
v < 3;
v++)
865 std::ostringstream error_message;
867 <<
"Error in parametrisation of boundary coordinates \n"
868 <<
"for vertex " <<
v <<
" [alt=" <<
alt <<
"] in facet "
912 1 +
nod_pt->position_time_stepper_pt()->nprev_values();
919 for (
unsigned i = 0;
i < 3;
i++)
932 for (
unsigned e = 0;
e <
nel;
e++)
951 for (
unsigned j = 0;
j <
nnod;
j++)
958 for (
unsigned i = 0;
i < 3;
i++)
967 "orig_overly_distorted_element%i.dat",
974 for (
unsigned j = 0;
j <
nnod;
j++)
977 for (
unsigned i = 0;
i < 3;
i++)
989 std::ostringstream error_message;
991 <<
"A number of elements, namely: " <<
count
992 <<
" are inverted after snapping. Their shapes are in "
993 <<
" overly_distorted_element*.dat and "
994 "orig_overly_distorted_element*.dat"
995 <<
"Next person to get this error: Please implement a straightforward\n"
996 <<
"variant of one of the functors in src/mesh_smoothing to switch\n"
997 <<
"to harmonic mapping\n"
1004 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...
A geometric object is an object that provides a parametrised description of its shape via the functio...
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...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
For the e-th finite element on boundary b, return int to indicate the face_index of the face adjacent...
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...
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
unsigned nboundary() const
Return number of boundaries.
unsigned long nnode() const
Return number of nodes in the mesh.
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
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....
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.
void snap_nodes_onto_geometric_objects()
Move the nodes on boundaries with associated GeomObjects so that they exactly coincide with the geome...
Vector< double > Region_attribute
Vector of attributes associated with the elements in each region NOTE: double is enforced on us by te...
unsigned nregion()
Return the number of regions specified by attributes.
std::map< unsigned, TetMeshFacetedSurface * > Tet_mesh_faceted_surface_pt
Reverse lookup scheme: Pointer to faceted surface (if any!) associated with boundary b.
Vector< std::map< unsigned, Vector< FiniteElement * > > > Boundary_region_element_pt
Storage for elements adjacent to a boundary in a particular region.
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 add_element_in_region_pt(FiniteElement *const &elem_pt, const unsigned ®ion_id)
Add an element to a particular region; this helper checks if the specified element and region ID alre...
void setup_boundary_element_info()
Setup lookup schemes which establish which elements are located next to mesh's boundaries (wrapper to...
Vector< std::map< unsigned, Vector< int > > > Face_index_region_at_boundary
Storage for the face index adjacent to a boundary in a particular region.
std::map< unsigned, Vector< Vector< double > > > Triangular_facet_vertex_boundary_coordinate
Boundary coordinates of vertices in triangular facets associated with given boundary....
void regenerate_region_boundary_lookups()
Clear and regenerate the lookup schemes for bulk elements and their corresponding face indices which ...
Vector< Vector< FiniteElement * > > Region_element_pt
Vectors of vectors of elements in each region (note: this just stores them; the region IDs are contai...
Facet for Tet mesh generation. Can lie on boundary (identified via one-based enumeration!...
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....
Base class for closed tet mesh boundary bounded by polygonal planar facets.
Base class for tet mesh boundary defined by polygonal planar facets.
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...
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...