60 const unsigned n_element =
nelement();
63 for (
unsigned e = 0;
e < n_element;
e++)
71 outfile <<
"Element: " <<
e <<
" " << fe_pt << std::endl;
75 if (fe_pt->
dim() == 1)
82 const unsigned n_node = fe_pt->
nnode_1d();
85 for (
unsigned n = 0; n < n_node; n++)
89 std::set<unsigned>* boundaries_pt = 0;
95 if (boundaries_pt != 0)
98 const unsigned n_bound_node_lives_on = (*boundaries_pt).size();
101 if (n_bound_node_lives_on > 1)
104 "In a 1D mesh a node shouldn't be able to live on more than\n";
105 error_message +=
"one boundary, yet this node claims to.";
108 OOMPH_CURRENT_FUNCTION,
109 OOMPH_EXCEPTION_LOCATION);
112 else if (n_bound_node_lives_on == 1)
115 const std::set<unsigned>::iterator boundary =
116 boundaries_pt->begin();
137 else if (n == n_node - 1)
158 for (
unsigned b = 0; b < n_bound; b++)
168 std::ostringstream error_stream;
169 error_stream <<
"Boundary " << b
170 <<
" has no element adjacent to it\n";
172 OOMPH_CURRENT_FUNCTION,
173 OOMPH_EXCEPTION_LOCATION);
183 std::ostringstream error_stream;
184 error_stream <<
"Boundary " << b <<
" has " << n_element
185 <<
" elements adjacent to it.\n"
186 <<
"This shouldn't occur in a 1D mesh.\n";
188 OOMPH_CURRENT_FUNCTION,
189 OOMPH_EXCEPTION_LOCATION);
197 const unsigned face_index_at_boundary_size =
200 if (face_index_at_boundary_size != 1)
202 std::ostringstream error_stream;
204 <<
"Face_index_at_boundary[" << b <<
"] has size"
205 << face_index_at_boundary_size <<
" which does not make sense.\n"
206 <<
"In a 1D mesh its size should always be one since only\n"
207 <<
"one element can be adjacent to any particular boundary";
209 OOMPH_CURRENT_FUNCTION,
210 OOMPH_EXCEPTION_LOCATION);
221 for (
unsigned b = 0; b < n_bound; b++)
224 outfile <<
"Boundary: " << b <<
" is adjacent to " << n_element
225 <<
" elements" << std::endl;
228 for (
unsigned e = 0;
e < n_element;
e++)
231 outfile <<
"Boundary element:" << fe_pt
232 <<
" 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...
void setup_boundary_element_info()
Set up lookup schemes which establish which elements are located next to mesh's boundaries (wrapper t...
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...
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
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...
An OomphLibError object which should be thrown when an run-time error is encountered....
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...