26 #ifndef OOMPH_ONE_D_MESH_TEMPLATE_CC
27 #define OOMPH_ONE_D_MESH_TEMPLATE_CC
38 template<
class ELEMENT>
51 Element_pt[0] =
new ELEMENT;
55 const unsigned n_node =
56 dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
59 Node_pt.resize(1 + (n_node - 1) *
N);
62 unsigned node_count = 0;
65 const double xinit = Xmin;
68 const double el_length = Length / double(
N);
83 finite_element_pt(0)->construct_boundary_node(0, time_stepper_pt);
86 node_pt(node_count)->x(0) = xinit;
89 add_boundary_node(0, Node_pt[node_count]);
98 for (
unsigned jnod = 1; jnod < (n_node - 1); jnod++)
101 Node_pt[node_count] =
102 finite_element_pt(0)->construct_node(jnod, time_stepper_pt);
105 finite_element_pt(0)->local_fraction_of_node(jnod, s_fraction);
108 node_pt(node_count)->x(0) = xinit + el_length * s_fraction[0];
118 Node_pt[node_count] = finite_element_pt(0)->construct_boundary_node(
119 n_node - 1, time_stepper_pt);
122 node_pt(node_count)->x(0) = xinit + Length;
125 add_boundary_node(1, Node_pt[node_count]);
143 Node_pt[node_count] =
144 finite_element_pt(0)->construct_boundary_node(0, time_stepper_pt);
147 node_pt(node_count)->x(0) = xinit;
150 add_boundary_node(0, Node_pt[node_count]);
159 for (
unsigned jnod = 1; jnod < n_node; jnod++)
162 Node_pt[node_count] =
163 finite_element_pt(0)->construct_node(jnod, time_stepper_pt);
166 finite_element_pt(0)->local_fraction_of_node(jnod, s_fraction);
169 node_pt(node_count)->x(0) = xinit + el_length * s_fraction[0];
180 for (
unsigned e = 1;
e < (
N - 1);
e++)
183 Element_pt[
e] =
new ELEMENT;
187 finite_element_pt(
e)->node_pt(0) =
188 finite_element_pt(
e - 1)->node_pt((n_node - 1));
191 for (
unsigned jnod = 1; jnod < n_node; jnod++)
194 Node_pt[node_count] =
195 finite_element_pt(
e)->construct_node(jnod, time_stepper_pt);
198 finite_element_pt(
e)->local_fraction_of_node(jnod, s_fraction);
201 node_pt(node_count)->x(0) = xinit + el_length * (
e + s_fraction[0]);
213 Element_pt[
N - 1] =
new ELEMENT;
217 finite_element_pt(
N - 1)->node_pt(0) =
218 finite_element_pt(
N - 2)->node_pt(n_node - 1);
222 for (
unsigned jnod = 1; jnod < (n_node - 1); jnod++)
225 Node_pt[node_count] =
226 finite_element_pt(
N - 1)->construct_node(jnod, time_stepper_pt);
229 finite_element_pt(
N - 1)->local_fraction_of_node(jnod, s_fraction);
232 node_pt(node_count)->x(0) = xinit + el_length * (
N - 1 + s_fraction[0]);
242 Node_pt[node_count] = finite_element_pt(
N - 1)->construct_boundary_node(
243 n_node - 1, time_stepper_pt);
246 node_pt(node_count)->x(0) = xinit + Length;
249 add_boundary_node(1, Node_pt[node_count]);
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh constuction routine, called by all constructors.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...