40 if (outfile)
doc =
true;
54 vector_of_boundary_element_pt.resize(nbound);
63 for (
unsigned e = 0;
e < nel;
e++)
68 if (
doc) outfile <<
"Element: " <<
e <<
" " << fe_pt << std::endl;
71 if (fe_pt->
dim() == 2)
76 unsigned nnode_1d = fe_pt->
nnode_1d();
79 for (
unsigned i0 = 0; i0 < nnode_1d; i0++)
81 for (
unsigned i1 = 0; i1 < nnode_1d; i1++)
84 unsigned j = i0 + i1 * nnode_1d;
88 std::set<unsigned>* boundaries_pt = 0;
92 if (boundaries_pt != 0)
96 for (std::set<unsigned>::iterator it = boundaries_pt->begin();
97 it != boundaries_pt->end();
105 std::find(vector_of_boundary_element_pt[*it].begin(),
106 vector_of_boundary_element_pt[*it].end(),
109 if (b_el_it == vector_of_boundary_element_pt[*it].end())
111 vector_of_boundary_element_pt[*it].push_back(fe_pt);
123 if (boundary_identifier(*it, fe_pt) == 0)
129 if (((i0 == 0) || (i0 == nnode_1d - 1)) &&
130 ((i1 == 0) || (i1 == nnode_1d - 1)))
133 (*boundary_identifier(*it, fe_pt))
134 .push_back(1 * (2 * i0 / (nnode_1d - 1) - 1));
137 (*boundary_identifier(*it, fe_pt))
138 .push_back(2 * (2 * i1 / (nnode_1d - 1) - 1));
168 for (
unsigned i = 0;
i < nbound;
i++)
181 for (IT it = vector_of_boundary_element_pt[
i].begin();
182 it != vector_of_boundary_element_pt[
i].end();
189 std::map<int, unsigned> count;
192 for (
unsigned ii = 0; ii < 2; ii++)
195 for (
int sign = -1; sign < 3; sign += 2)
197 count[(ii + 1) * sign] = 0;
202 unsigned n_indicators = (*boundary_identifier(
i, fe_pt)).size();
203 for (
unsigned j = 0; j < n_indicators; j++)
205 count[(*boundary_identifier(
i, fe_pt))[j]]++;
207 delete boundary_identifier(
i, fe_pt);
218 for (
unsigned ii = 0; ii < 2; ii++)
221 for (
int sign = -1; sign < 3; sign += 2)
226 if (count[(ii + 1) * sign] == 2)
244 indicator = (ii + 1) * sign;
310 for (
unsigned i = 0;
i < nbound;
i++)
313 outfile <<
"Boundary: " <<
i <<
" is adjacent to " << nel <<
" elements"
317 for (
unsigned e = 0;
e < nel;
e++)
320 outfile <<
"Boundary element:" << fe_pt
321 <<
" Face index on boundary is "
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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...
void setup_boundary_element_info()
Setup lookup schemes which establish whic elements are located next to mesh's boundaries (wrapper to ...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...