47 if(outfile) { doc =
true; }
63 const unsigned n_element =
nelement();
66 for(
unsigned e=0;
e<n_element;
e++)
72 if(doc) { outfile <<
"Element: " <<
e <<
" " << fe_pt << std::endl; }
81 const unsigned n_node = fe_pt->
nnode_1d();
84 for (
unsigned n=0;n<n_node;n++)
87 std::set<unsigned>* boundaries_pt = 0;
96 const unsigned n_bound_node_lives_on = (*boundaries_pt).size();
99 if(n_bound_node_lives_on>1)
102 "In a 1D mesh a node shouldn't be able to live on more than\n";
104 "one boundary, yet this node claims to.";
107 OOMPH_CURRENT_FUNCTION,
108 OOMPH_EXCEPTION_LOCATION);
111 else if(n_bound_node_lives_on==1)
114 const std::set<unsigned>::iterator boundary
115 = boundaries_pt->begin();
157 for(
unsigned b=0;b<n_bound;b++)
167 std::ostringstream error_stream;
168 error_stream <<
"Boundary " << b <<
" has no element adjacent to it\n";
170 OOMPH_CURRENT_FUNCTION,
171 OOMPH_EXCEPTION_LOCATION);
181 std::ostringstream error_stream;
182 error_stream <<
"Boundary " << b <<
" has " << n_element
183 <<
" elements adjacent to it.\n" 184 <<
"This shouldn't occur in a 1D mesh.\n";
186 OOMPH_CURRENT_FUNCTION,
187 OOMPH_EXCEPTION_LOCATION);
195 const unsigned face_index_at_boundary_size
198 if(face_index_at_boundary_size != 1)
200 std::ostringstream error_stream;
202 <<
"Face_index_at_boundary[" << b <<
"] has size" 203 << face_index_at_boundary_size
204 <<
" which does not make sense.\n" 205 <<
"In a 1D mesh its size should always be one since only\n" 206 <<
"one element can be adjacent to any particular boundary";
208 OOMPH_CURRENT_FUNCTION,
209 OOMPH_EXCEPTION_LOCATION);
220 for(
unsigned b=0;b<n_bound;b++)
223 outfile <<
"Boundary: " << b
224 <<
" 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 " void setup_boundary_element_info()
A general Finite Element class.
bool Lookup_for_elements_next_boundary_is_setup
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...
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.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Vector< Vector< FiniteElement * > > Boundary_element_pt
Vector of Vector of pointers to elements on the boundaries: Boundary_element_pt(b,e)
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
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 overloa...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.