43 #include "meshes/fish_mesh.h" 50 using namespace oomph;
67 void get_source(
const Vector<double>& x,
double& source)
81 template<
class ELEMENT>
83 public virtual SolidMesh
98 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper) :
99 FishMesh<ELEMENT>(back_pt,time_stepper_pt),
100 RefineableFishMesh<ELEMENT>(back_pt,time_stepper_pt)
105 set_lagrangian_nodal_coordinates();
114 double xi_nose = this->Domain_pt->xi_nose();
115 double xi_tail = this->Domain_pt->xi_tail();
116 Undeformed_domain_pt=
new FishDomain(undeformed_back_pt,xi_nose,xi_tail);
119 unsigned n_element=this->nelement();
120 for (
unsigned e=0;e<n_element;e++)
123 ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(this->element_pt(e));
128 el_pt->set_undeformed_macro_elem_pt(
129 Undeformed_domain_pt->macro_element_pt(e));
137 delete Undeformed_domain_pt;
145 Domain* Undeformed_domain_pt;
183 template<
class ELEMENT>
200 void doc_solution(DocInfo& doc_info);
216 bool update_all_solid_nodes=
true;
217 mesh_pt()->node_update(update_all_solid_nodes);
224 PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
225 mesh_pt()->element_pt());
248 template<
class ELEMENT>
263 GeomObject* undeformed_fish_back_pt=
new 269 undeformed_fish_back_pt);
277 unsigned nnod=mesh_pt()->finite_element_pt(0)->nnode();
280 Doc_node_pt=mesh_pt()->finite_element_pt(0)->node_pt(nnod-1);
283 cout << std::endl <<
"Control node is located at: " 284 << Doc_node_pt->x(0) <<
" " << Doc_node_pt->x(1) << std::endl << std::endl;
288 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
289 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
292 if (CommandLineArgs::Argc>1)
294 mesh_pt()->max_permitted_error()=0.05;
295 mesh_pt()->min_permitted_error()=0.005;
297 mesh_pt()->doc_adaptivity_targets(cout);
306 unsigned num_bound = mesh_pt()->nboundary();
307 for(
unsigned ibound=0;ibound<num_bound;ibound++)
309 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
310 for (
unsigned inod=0;inod<num_nod;inod++)
312 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
318 for(
unsigned ibound=0;ibound<num_bound;ibound++)
321 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
322 for (
unsigned inod=0;inod<num_nod;inod++)
324 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
329 unsigned n_element = mesh_pt()->nelement();
330 for(
unsigned i=0;i<n_element;i++)
333 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
344 for(
unsigned ibound=0;ibound<num_bound;ibound++)
346 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
347 for (
unsigned inod=0;inod<num_nod;inod++)
349 for (
unsigned i=0;i<2;i++)
351 mesh_pt()->boundary_node_pt(ibound,inod)->pin_position(i);
357 for(
unsigned i=0;i<n_element;i++)
360 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
363 el_pt->constitutive_law_pt() =
369 PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
370 mesh_pt()->element_pt());
373 cout << assign_eqn_numbers() << std::endl;
382 bool update_all_solid_nodes=
true;
383 mesh_pt()->node_update(update_all_solid_nodes);
386 mesh_pt()->set_lagrangian_nodal_coordinates();
394 template<
class ELEMENT>
404 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
406 some_file.open(filename);
407 mesh_pt()->output(some_file,npts);
414 <<
static_cast<Circle*
>(mesh_pt()->fish_back_pt())->y_c()
415 <<
" " << Doc_node_pt->value(0) << std::endl;
423 template<
class ELEMENT>
431 doc_info.set_directory(
"RESLT");
438 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
439 Trace_file.open(filename);
441 Trace_file <<
"VARIABLES=\"y<sub>circle</sub>\",\"u<sub>control</sub>\"" 446 for(
unsigned i=0;i<nstep;i++)
453 doc_solution(doc_info);
457 Fish_back_pt->y_c()+=0.03;
467 int main(
int argc,
char* argv[])
471 CommandLineArgs::setup(argc,argv);
486 RefineablePseudoSolidNodeUpdateElement<RefineableQPoissonElement<2,3>,
487 RefineableQPVDElement<2,3> >
ElasticFishMesh(GeomObject *back_pt, GeomObject *undeformed_back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Build underlying adaptive fish mesh and then set current Eulerian coordinates to be the ...
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
int main(int argc, char *argv[])
double Strength
Strength of source function: default value 1.0.
Refineable fish mesh upgraded to become a solid mesh.
void get_source(const Vector< double > &x, double &source)
Const source function.
virtual ~ElasticFishMesh()
Destructor: Kill "undeformed" Domain.
Namespace for const source term in Poisson equation.
GeneralCircle "upgraded" to a GeneralisedElement: Circular ring whose position is given by The ring...
double Nu
Poisson's ratio.