39 #include "meshes/fish_mesh.h"  
   43 using namespace oomph;
 
   60  void get_source(
const Vector<double>& x, 
double& source)
 
   74 template<
class ELEMENT>
 
   76                         public virtual SolidMesh 
 
   91                  TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper) : 
 
   92   FishMesh<ELEMENT>(back_pt,time_stepper_pt), 
 
   93   RefineableFishMesh<ELEMENT>(back_pt,time_stepper_pt)
 
   98    set_lagrangian_nodal_coordinates();
 
  107    double xi_nose = this->Domain_pt->xi_nose(); 
 
  108    double xi_tail = this->Domain_pt->xi_tail();
 
  109    Undeformed_domain_pt=
new FishDomain(undeformed_back_pt,xi_nose,xi_tail);
 
  112    unsigned n_element=this->nelement();
 
  113    for (
unsigned e=0;e<n_element;e++)
 
  116      ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(this->element_pt(e));
 
  121      el_pt->set_undeformed_macro_elem_pt(
 
  122       Undeformed_domain_pt->macro_element_pt(e));
 
  130    delete Undeformed_domain_pt;
 
  176 template<
class ELEMENT>
 
  193  void doc_solution(DocInfo& doc_info);
 
  209    bool update_all_solid_nodes=
true;
 
  210    mesh_pt()->node_update(update_all_solid_nodes);
 
  213    mesh_pt()->set_lagrangian_nodal_coordinates();
 
  221    PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
 
  222     mesh_pt()->element_pt());
 
  242 template<
class ELEMENT>
 
  253  Fish_back_pt=
new Circle(x_c,y_c,r_back);
 
  257  GeomObject* undeformed_fish_back_pt=
new Circle(x_c,y_c,r_back);
 
  262                                                  undeformed_fish_back_pt);
 
  270  unsigned nnod=mesh_pt()->finite_element_pt(0)->nnode();
 
  273  Doc_node_pt=mesh_pt()->finite_element_pt(0)->node_pt(nnod-1);
 
  276  cout << std::endl <<  
"Control node is located at: "  
  277       << Doc_node_pt->x(0) << 
" " << Doc_node_pt->x(1) << std::endl << std::endl;
 
  281  Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
 
  282  mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
 
  285  if (CommandLineArgs::Argc>1) 
 
  287    mesh_pt()->max_permitted_error()=0.05;
 
  288    mesh_pt()->min_permitted_error()=0.005;
 
  290  mesh_pt()->doc_adaptivity_targets(cout);
 
  299  unsigned num_bound = mesh_pt()->nboundary();
 
  300  for(
unsigned ibound=0;ibound<num_bound;ibound++)
 
  302    unsigned num_nod=mesh_pt()->nboundary_node(ibound);
 
  303    for (
unsigned inod=0;inod<num_nod;inod++)
 
  305      mesh_pt()->boundary_node_pt(ibound,inod)->pin(0); 
 
  311  for(
unsigned ibound=0;ibound<num_bound;ibound++)
 
  314    unsigned num_nod=mesh_pt()->nboundary_node(ibound);
 
  315    for (
unsigned inod=0;inod<num_nod;inod++)
 
  317      mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
 
  322  unsigned n_element = mesh_pt()->nelement();
 
  323  for(
unsigned i=0;i<n_element;i++)
 
  326    ELEMENT *el_pt = 
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
 
  337  for(
unsigned ibound=0;ibound<num_bound;ibound++)
 
  339    unsigned num_nod=mesh_pt()->nboundary_node(ibound);
 
  340    for (
unsigned inod=0;inod<num_nod;inod++)
 
  342      for (
unsigned i=0;i<2;i++)
 
  344        mesh_pt()->boundary_node_pt(ibound,inod)->pin_position(i); 
 
  350  for(
unsigned i=0;i<n_element;i++)
 
  353    ELEMENT *el_pt = 
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
 
  356    el_pt->constitutive_law_pt() =
 
  361  PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
 
  362   mesh_pt()->element_pt());
 
  366  cout << assign_eqn_numbers() << std::endl; 
 
  375  bool update_all_solid_nodes=
true;
 
  376  mesh_pt()->node_update(update_all_solid_nodes);
 
  379  mesh_pt()->set_lagrangian_nodal_coordinates();
 
  387 template<
class ELEMENT>
 
  397  sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
 
  399  some_file.open(filename);
 
  400  mesh_pt()->output(some_file,npts);
 
  407   << 
static_cast<Circle*
>(mesh_pt()->fish_back_pt())->y_c()
 
  408   << 
" " << Doc_node_pt->value(0) << std::endl;
 
  416 template<
class ELEMENT>
 
  424  doc_info.set_directory(
"RESLT");
 
  431  sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
 
  432  Trace_file.open(filename);
 
  434  Trace_file << 
"VARIABLES=\"y<sub>circle</sub>\",\"u<sub>control</sub>\"" 
  439  for(
unsigned i=0;i<nstep;i++)
 
  446    doc_solution(doc_info);
 
  450    Fish_back_pt->y_c()+=0.3;
 
  460 int main(
int argc, 
char* argv[])
 
  464  CommandLineArgs::setup(argc,argv);
 
  478    RefineablePseudoSolidNodeUpdateElement<RefineableQPoissonElement<2,3>,
 
  479                                       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 ...
virtual ~ElasticFishMesh()
Destructor: Kill "undeformed" Domain.
Domain * Undeformed_domain_pt
Pointer to "undeformed" Domain – used to determine the Lagrangian coordinates of any newly created So...
int main(int argc, char *argv[])
Driver for simple elastic problem. If there are any command line arguments, we regard this as a valid...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void get_source(const Vector< double > &x, double &source)
Const source function.
double Strength
Strength of source function: default value 1.0.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
double Nu
Poisson's ratio.
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.