39 namespace BrickFromTetMeshHelper
66 if (outfile) doc=
true;
69 unsigned nbound=nboundary();
73 outfile <<
"The number of boundaries is " << nbound <<
"\n";
79 Boundary_element_pt.clear();
80 Face_index_at_boundary.clear();
81 Boundary_element_pt.resize(nbound);
82 Face_index_at_boundary.resize(nbound);
97 vector_of_boundary_element_pt.resize(nbound);
113 unsigned nel=nelement();
114 for (
unsigned e=0;
e<nel;
e++)
121 if (doc) outfile <<
"Element: " <<
e <<
" " << fe_pt << std::endl;
127 unsigned nnode_1d=fe_pt->
nnode_1d();
130 for (
unsigned i0=0;i0<nnode_1d;i0++)
132 for (
unsigned i1=0;i1<nnode_1d;i1++)
134 for (
unsigned i2=0;i2<nnode_1d;i2++)
138 unsigned j=i0+i1*nnode_1d+i2*nnode_1d*nnode_1d;
144 std::set<unsigned>* boundaries_pt=0;
150 if (boundaries_pt!=0)
154 for (std::set<unsigned>::iterator it=boundaries_pt->begin();
155 it!=boundaries_pt->end();++it)
160 unsigned boundary_id=*it;
167 std::find(vector_of_boundary_element_pt[*it].begin(),
168 vector_of_boundary_element_pt[*it].end(),
172 if(b_el_it == vector_of_boundary_element_pt[*it].end())
174 vector_of_boundary_element_pt[*it].push_back(fe_pt);
186 if (boundary_identifier(boundary_id,fe_pt)==0)
196 tmp_vect_pt.push_back(tmp_pt);
200 boundary_identifier(boundary_id,fe_pt)=tmp_pt;
205 if (((i0==0)||(i0==nnode_1d-1))&&((i1==0)||(i1==nnode_1d-1))
206 &&((i2==0)||(i2==nnode_1d-1)))
210 (*boundary_identifier(boundary_id,fe_pt)).
211 push_back(1*(2*i0/(nnode_1d-1)-1));
214 (*boundary_identifier(boundary_id,fe_pt)).
215 push_back(2*(2*i1/(nnode_1d-1)-1));
218 (*boundary_identifier(boundary_id,fe_pt)).
219 push_back(3*(2*i2/(nnode_1d-1)-1));
234 for (
unsigned i=0;
i<nbound;
i++)
238 for (IT it=vector_of_boundary_element_pt[
i].begin();
239 it!=vector_of_boundary_element_pt[
i].end();
246 std::map<int,unsigned> count;
249 for (
int ii=0;ii<3;ii++)
253 for (
int sign=-1;sign<3;sign+=2)
255 count[(ii+1)*sign]=0;
266 unsigned n_indicators=(*boundary_identifier(
i,fe_pt)).size();
267 for (
unsigned j=0;j<n_indicators;j++)
269 count[(*boundary_identifier(
i,fe_pt))[j] ]++;
279 for (
int ii=0;ii<3;ii++)
282 for (
int sign=-1;sign<3;sign+=2)
286 if (count[(ii+1)*sign]==4)
288 indicator=(ii+1)*sign;
291 Boundary_element_pt[
i].push_back(*it);
292 Face_index_at_boundary[
i].push_back(indicator);
304 for (
unsigned i=0;
i<nbound;
i++)
306 unsigned nel=Boundary_element_pt[
i].
size();
307 outfile <<
"Boundary: " <<
i 308 <<
" is adjacent to " << nel
309 <<
" elements" << std::endl;
312 for (
unsigned e=0;
e<nel;
e++)
315 outfile <<
"Boundary element:" << fe_pt
316 <<
" Face index along boundary is " 317 << Face_index_at_boundary[
i][
e] << std::endl;
324 Lookup_for_elements_next_boundary_is_setup=
true;
328 unsigned n=tmp_vect_pt.size();
329 for (
unsigned i=0;
i<n;
i++)
331 delete tmp_vect_pt[
i];
void setup_boundary_element_info()
A general Finite Element class.
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double Face_position_tolerance
Tolerance for mismatch during setup of boundary coordinates.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overloa...