32 #include "constitutive.h"
35 #include "meshes/rectangular_quadmesh.h"
39 using namespace oomph;
59 BrokenCopy::broken_copy(
"WarpedLine");
65 BrokenCopy::broken_assign(
"WarpedLine");
73 void position(
const Vector<double>& zeta, Vector<double>& r)
const
76 r[0] = zeta[0]+5.0*Ampl*zeta[0]*(zeta[0]-1.0)*(zeta[0]-0.7);
77 r[1] = 1.0+Ampl*0.5*(1.0-cos(2.0*MathematicalConstants::Pi*zeta[0]));
83 void position(
const unsigned& t,
const Vector<double>& zeta,
84 Vector<double>& r)
const
90 double&
ampl() {
return Ampl;}
130 template<
class ELEMENT>
148 unsigned n_nod = solid_mesh_pt()->nboundary_node(b);
149 for(
unsigned i=0;i<n_nod;i++)
151 Node* nod_pt= solid_mesh_pt()->boundary_node_pt(b,i);
154 Vector<double> zeta(1);
155 nod_pt->get_coordinates_on_boundary(b,zeta);
170 {
return Solid_mesh_pt;}
175 PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
176 solid_mesh_pt()->element_pt());
185 ElasticRefineableRectangularQuadMesh<ELEMENT>* Solid_mesh_pt;
196 template<
class ELEMENT>
215 solid_mesh_pt() =
new ElasticRefineableRectangularQuadMesh<ELEMENT>(
219 Problem::mesh_pt()=solid_mesh_pt();
222 solid_mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
226 unsigned n_element =solid_mesh_pt()->nelement();
227 for(
unsigned i=0;i<n_element;i++)
230 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(solid_mesh_pt()->element_pt(i));
233 el_pt->constitutive_law_pt()=&Global_Physical_Variables::Constitutive_law;
237 solid_mesh_pt()->refine_uniformly();
242 for (
unsigned b=0;b<4;b++)
244 unsigned n_side = solid_mesh_pt()->nboundary_node(b);
247 for(
unsigned i=0;i<n_side;i++)
249 solid_mesh_pt()->boundary_node_pt(b,i)->pin_position(0);
250 solid_mesh_pt()->boundary_node_pt(b,i)->pin_position(1);
256 PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
257 solid_mesh_pt()->element_pt());
260 cout <<
"Number of dofs: " << assign_eqn_numbers() << std::endl;
263 Doc_info.set_directory(
"RESLT");
272 template<
class ELEMENT>
284 sprintf(filename,
"%s/soln%i.dat",Doc_info.directory().c_str(),
286 some_file.open(filename);
287 solid_mesh_pt()->output(some_file,n_plot);
310 unsigned max_adapt=1;
314 for(
unsigned i=0;i<nstep;i++)
321 problem.newton_solve(max_adapt);
Problem class for deformation of elastic block by prescribed boundary motion.
void actions_after_newton_solve()
Update function (empty)
void actions_after_adapt()
Actions after adapt: Pin the redundant solid pressures (if any)
void doc_solution()
Doc the solution.
PrescribedBoundaryDisplacementProblem()
Constructor:
ElasticRefineableRectangularQuadMesh< ELEMENT > *& solid_mesh_pt()
Access function for the solid mesh.
void actions_before_newton_solve()
Update boundary position directly.
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Parametrised position on object: r(zeta). Evaluated at previous timestep. t=0: current time; t>0: pre...
~WarpedLine()
Empty Destructor.
WarpedLine(const WarpedLine &dummy)
Broken copy constructor.
WarpedLine(const double &l)
Constructor: Specify amplitude of deflection from straight horizontal line.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position vector at Lagrangian coordinate zeta.
void operator=(const WarpedLine &)
Broken assignment operator.
double & ampl()
Access to amplitude.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
double Nu
Poisson's ratio.
WarpedLine Boundary_geom_object(0.0)
GeomObject specifying the shape of the boundary: Initially it's flat.