210 GeomObject* substrate_pt,
211 TimeStepper* time_stepper_pt) :
212 SimpleRectangularQuadMesh<ELEMENT>(nx,ny,lx,h,time_stepper_pt),
213 Default_height(h), Height_fct_pt(0), Substrate_pt(substrate_pt)
225 unsigned np =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
228 unsigned nspine = (np-1)*nx+1;
229 Spine_pt.reserve(nspine);
233 double dx=lx/double(nx);
241 Spine* new_spine_pt=
new Spine(h);
242 Spine_pt.push_back(new_spine_pt);
245 SpineNode* nod_pt=element_node_pt(0,0);
248 nod_pt->spine_pt() = new_spine_pt;
251 nod_pt->fraction() = 0.0;
254 nod_pt->spine_mesh_pt() =
this;
257 nod_pt->node_update_fct_id()=0;
266 Vector<double> parameters(1);
272 new_spine_pt->set_geom_parameter(parameters);
278 Vector<GeomObject*> geom_object_pt(1);
282 new_spine_pt->set_geom_object_pt(geom_object_pt);
288 for(
unsigned i=0;i<ny;i++)
291 for(
unsigned l1=1;l1<np;l1++)
294 SpineNode* nod_pt=element_node_pt(i*nx,l1*np);
297 nod_pt->spine_pt() = new_spine_pt;
300 nod_pt->fraction()=(double(i)+double(l1)/double(np-1))/
double(ny);
303 nod_pt->spine_mesh_pt() =
this;
306 nod_pt->node_update_fct_id()=0;
316 for(
unsigned j=0;j<nx;j++)
321 for(
unsigned l2=1;l2<npmax;l2++)
324 new_spine_pt=
new Spine(h);
327 Spine_pt.push_back(new_spine_pt);
330 SpineNode* nod_pt=element_node_pt(j,l2);
333 nod_pt->spine_pt() = new_spine_pt;
336 nod_pt->fraction() = 0.0;
339 nod_pt->spine_mesh_pt() =
this;
342 nod_pt->node_update_fct_id()=0;
350 Vector<double> parameters(1);
353 parameters[0]=x_lo+double(j)*dx + double(l2)*dx/double(np-1);
356 new_spine_pt->set_geom_parameter(parameters);
361 Vector<GeomObject*> geom_object_pt(1);
365 new_spine_pt->set_geom_object_pt(geom_object_pt);
369 for(
unsigned i=0;i<ny;i++)
372 for(
unsigned l1=1;l1<np;l1++)
375 SpineNode* nod_pt=element_node_pt(i*nx+j,l1*np+l2);
378 nod_pt->spine_pt() = new_spine_pt;
381 nod_pt->fraction()=(double(i)+double(l1)/double(np-1))/
double(ny);
384 nod_pt->spine_mesh_pt() =
this;
387 nod_pt->node_update_fct_id()=0;
523 GeomObject* substrate_pt=
537 mesh_pt()->node_update();
540 unsigned nspine=mesh_pt()->nspine();
543 mesh_pt()->spine_pt(
i)->spine_height_pt()->pin(0);
550 unsigned num_bound = mesh_pt()->nboundary();
559 for (
unsigned i=0;
i<2;
i++)
567 mesh_pt()->boundary_node_pt(
ibound,
inod)->pin(1);
582 for (
unsigned i=0;
i<2;
i++)
584 mesh_pt()->boundary_node_pt(
ibound,
inod)->set_value(
i,0.0);
589 mesh_pt()->boundary_node_pt(
ibound,
inod)->set_value(1,0.0);
600 double y=mesh_pt()->boundary_node_pt(
ibound,
inod)->x(1);
602 mesh_pt()->boundary_node_pt(
ibound,
inod)->set_value(0,
y*(Ly-
y));
603 mesh_pt()->boundary_node_pt(
ibound,
inod)->set_value(1,0.0);
610 unsigned n_element = mesh_pt()->nelement();
SimpleSpineMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &h, GeomObject *substrate_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in x-direction, number of elements in y-direction,...