26 #ifndef OOMPH_BACKWARD_STEP_MESH_TEMPLATE_CC
27 #define OOMPH_BACKWARD_STEP_MESH_TEMPLATE_CC
43 template<
class ELEMENT>
46 const unsigned& nx_cut_out,
47 const unsigned& ny_cut_out,
52 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
55 std::map<Node*, bool> keep;
60 for (
unsigned i = 0;
i < nx;
i++)
62 for (
unsigned j = 0; j < ny; j++)
65 if ((
i > (nx_cut_out - 1)) && (j < ny_cut_out))
67 el_killed_pt.push_back(el_pt);
71 el_retained_pt.push_back(el_pt);
72 unsigned nnod_el = el_pt->
nnode();
73 for (
unsigned jj = 0; jj < nnod_el; jj++)
75 keep[el_pt->
node_pt(jj)] =
true;
84 std::map<Node*, std::set<unsigned>> boundaries;
85 unsigned nnod = this->nnode();
86 for (
unsigned j = 0; j < nnod; j++)
88 std::set<unsigned>* aux_pt = 0;
89 this->node_pt(j)->get_boundaries_pt(aux_pt);
92 boundaries[this->node_pt(j)] = (*aux_pt);
97 this->remove_boundary_nodes();
100 this->set_nboundary(6);
104 this->Node_pt.clear();
105 for (
unsigned j = 0; j < nnod; j++)
107 Node* nod_pt = node_backup_pt[j];
110 this->Node_pt.push_back(nod_pt);
111 std::set<unsigned> aux = boundaries[nod_pt];
112 for (std::set<unsigned>::iterator it = boundaries[nod_pt].begin();
113 it != boundaries[nod_pt].end();
118 this->add_boundary_node(b, nod_pt);
123 delete node_backup_pt[j];
128 unsigned i = nx_cut_out - 1;
129 for (
unsigned j = 0; j < ny_cut_out; j++)
132 unsigned nnod_1d = el_pt->
nnode_1d();
133 for (
unsigned jj = 0; jj < nnod_1d; jj++)
135 unsigned jnod = (nnod_1d - 1) + jj * nnod_1d;
139 this->convert_to_boundary_node(nod_pt);
141 this->add_boundary_node(1, el_pt->
node_pt(jnod));
146 unsigned j = ny_cut_out;
147 for (
unsigned i = nx_cut_out;
i < nx;
i++)
150 unsigned nnod_1d = el_pt->
nnode_1d();
151 for (
unsigned jj = 0; jj < nnod_1d; jj++)
157 this->convert_to_boundary_node(nod_pt);
159 this->add_boundary_node(2, el_pt->
node_pt(jnod));
165 this->Element_pt.clear();
166 unsigned n_retained = el_retained_pt.size();
167 for (
unsigned e = 0;
e < n_retained;
e++)
169 this->Element_pt.push_back(el_retained_pt[
e]);
171 unsigned n_killed = el_killed_pt.size();
172 for (
unsigned e = 0;
e < n_killed;
e++)
174 delete el_killed_pt[
e];
179 this->setup_boundary_element_info();
void build_mesh(const unsigned &nx, const unsigned &ny, const unsigned &nx_cut_out, const unsigned &ny_cut_out, const double &lx, const double &ly)
Actual build function.
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nnode() const
Return the number of nodes.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...