34 namespace BrickFromTetMeshHelper
60 if (outfile)
doc =
true;
68 outfile <<
"The number of boundaries is " << nbound <<
"\n";
92 vector_of_boundary_element_pt.resize(nbound);
108 for (
unsigned e = 0;
e < nel;
e++)
115 if (
doc) outfile <<
"Element: " <<
e <<
" " << fe_pt << std::endl;
121 unsigned nnode_1d = fe_pt->
nnode_1d();
124 for (
unsigned i0 = 0; i0 < nnode_1d; i0++)
126 for (
unsigned i1 = 0; i1 < nnode_1d; i1++)
128 for (
unsigned i2 = 0; i2 < nnode_1d; i2++)
132 unsigned j = i0 + i1 * nnode_1d + i2 * nnode_1d * nnode_1d;
138 std::set<unsigned>* boundaries_pt = 0;
144 if (boundaries_pt != 0)
148 for (std::set<unsigned>::iterator it = boundaries_pt->begin();
149 it != boundaries_pt->end();
155 unsigned boundary_id = *it;
162 std::find(vector_of_boundary_element_pt[*it].begin(),
163 vector_of_boundary_element_pt[*it].end(),
167 if (b_el_it == vector_of_boundary_element_pt[*it].end())
169 vector_of_boundary_element_pt[*it].push_back(fe_pt);
181 if (boundary_identifier(boundary_id, fe_pt) == 0)
190 tmp_vect_pt.push_back(tmp_pt);
194 boundary_identifier(boundary_id, fe_pt) = tmp_pt;
200 if (((i0 == 0) || (i0 == nnode_1d - 1)) &&
201 ((i1 == 0) || (i1 == nnode_1d - 1)) &&
202 ((i2 == 0) || (i2 == nnode_1d - 1)))
206 (*boundary_identifier(boundary_id, fe_pt))
207 .push_back(1 * (2 * i0 / (nnode_1d - 1) - 1));
210 (*boundary_identifier(boundary_id, fe_pt))
211 .push_back(2 * (2 * i1 / (nnode_1d - 1) - 1));
214 (*boundary_identifier(boundary_id, fe_pt))
215 .push_back(3 * (2 * i2 / (nnode_1d - 1) - 1));
230 for (
unsigned i = 0;
i < nbound;
i++)
234 for (IT it = vector_of_boundary_element_pt[
i].begin();
235 it != vector_of_boundary_element_pt[
i].end();
242 std::map<int, unsigned> count;
245 for (
int ii = 0; ii < 3; ii++)
249 for (
int sign = -1; sign < 3; sign += 2)
251 count[(ii + 1) * sign] = 0;
262 unsigned n_indicators = (*boundary_identifier(
i, fe_pt)).size();
263 for (
unsigned j = 0; j < n_indicators; j++)
265 count[(*boundary_identifier(
i, fe_pt))[j]]++;
275 for (
int ii = 0; ii < 3; ii++)
278 for (
int sign = -1; sign < 3; sign += 2)
283 if (count[(ii + 1) * sign] == 4)
285 indicator = (ii + 1) * sign;
301 for (
unsigned i = 0;
i < nbound;
i++)
304 outfile <<
"Boundary: " <<
i <<
" is adjacent to " << nel <<
" elements"
308 for (
unsigned e = 0;
e < nel;
e++)
311 outfile <<
"Boundary element:" << fe_pt
312 <<
" Face index along boundary is "
324 unsigned n = tmp_vect_pt.size();
325 for (
unsigned i = 0;
i < n;
i++)
327 delete tmp_vect_pt[
i];
void setup_boundary_element_info()
Setup lookup schemes which establish whic elements are located next to mesh's boundaries (wrapper to ...
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
MapMatrixMixed is a generalised, STL-map-based, sparse(ish) matrix class with mixed indices.
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).
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() const
Return number of boundaries.
unsigned long nelement() const
Return number of elements in the mesh.
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...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
double Face_position_tolerance
Tolerance for mismatch during setup of boundary coordinates.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...