30 #ifndef OOMPH_GEOMPACK_MESH_TEMPLATE_CC 31 #define OOMPH_GEOMPACK_MESH_TEMPLATE_CC 47 template <
class ELEMENT>
52 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2,2);
55 unsigned nelem=Tmp_mesh_pt->nelement();
56 Element_pt.resize(nelem);
59 unsigned nnod=Tmp_mesh_pt->nnode();
63 unsigned nbound=Tmp_mesh_pt->nboundary();
64 set_nboundary(nbound);
67 for (
unsigned e=0;
e<nelem;
e++)
69 Element_pt[
e]=
new ELEMENT;
74 if (finite_element_pt(0)->nnode()!=4)
77 "GeompackQuadMesh can currently only deal with\n";
78 error_message +=
"four noded quads! \n";
79 error_message +=
"Generalisation to higher-order elements should be \n";
80 error_message +=
"straightforward but hasn't been done yet.\n";
81 error_message +=
"Do you want to volunteer? \n";
84 OOMPH_CURRENT_FUNCTION,
85 OOMPH_EXCEPTION_LOCATION);
90 unsigned nnod_el=Tmp_mesh_pt->finite_element_pt(0)->nnode();
93 for (
unsigned e=0;
e<nelem;
e++)
96 for (
unsigned j=0;j<nnod_el;j++)
100 finite_element_pt(
e)->construct_node(j,time_stepper_pt);
105 std::map<Node*,unsigned> global_number;
106 unsigned global_count=0;
108 for (
unsigned e=0;
e<nelem;
e++)
111 for (
unsigned j=0;j<nnod_el;j++)
115 Node* scaffold_node_pt=Tmp_mesh_pt->finite_element_pt(
e)->node_pt(j);
119 unsigned j_global=global_number[scaffold_node_pt];
128 global_number[scaffold_node_pt]=global_count;
134 Node_pt[global_count-1]=finite_element_pt(
e)->node_pt(j);
137 Node_pt[global_count-1]->
x(0)=scaffold_node_pt->
x(0);
138 Node_pt[global_count-1]->x(1)=scaffold_node_pt->
x(1);
143 std::set<unsigned>* boundaries_pt;
148 if (boundaries_pt!=0)
151 this->convert_to_boundary_node(Node_pt[global_count-1]);
153 for(std::set<unsigned>::iterator it=boundaries_pt->begin();
154 it!=boundaries_pt->end();++it)
156 add_boundary_node(*it,Node_pt[global_count-1]);
164 delete finite_element_pt(
e)->node_pt(j);
169 finite_element_pt(
e)->node_pt(j)=Node_pt[j_global-1];
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void build_from_scaffold(TimeStepper *time_stepper_pt)
Build mesh from scaffold.
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...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...