40 #include "meshes/fish_mesh.h"
47 using namespace oomph;
63 void get_source(
const Vector<double>& x,
double& source)
87 template<
class ELEMENT>
89 public virtual FishMesh<ELEMENT>,
90 public virtual MacroElementNodeUpdateMesh
101 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper) :
102 FishMesh<ELEMENT>(back_pt,time_stepper_pt)
107 unsigned n_element = this->nelement();
108 for(
unsigned i=0;i<n_element;i++)
111 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->element_pt(i));
114 Vector<GeomObject*> geom_object_pt(1);
115 geom_object_pt[0] = back_pt;
119 el_pt->set_node_update_info(geom_object_pt);
141 template<
class ELEMENT>
173 fish_mesh_pt()->node_update();
183 Mesh* Fish_back_mesh_pt;
194 template<
class ELEMENT>
204 ElasticallySupportedRingElement* fish_back_pt=
205 new ElasticallySupportedRingElement(x_c,y_c,r_back);
212 add_sub_mesh(Fish_mesh_pt);
215 Fish_back_mesh_pt=
new Mesh;
220 Fish_back_mesh_pt->add_element_pt(fish_back_pt);
223 add_sub_mesh(Fish_back_mesh_pt);
231 unsigned nnod=fish_mesh_pt()->finite_element_pt(0)->nnode();
234 Node* control_node_pt=fish_mesh_pt()->finite_element_pt(0)->node_pt(nnod-1);
238 dynamic_cast<ElasticallySupportedRingElement*
>(Fish_mesh_pt->fish_back_pt())->
239 set_load_pt(control_node_pt);
244 unsigned num_bound = fish_mesh_pt()->nboundary();
245 for(
unsigned ibound=0;ibound<num_bound;ibound++)
247 unsigned num_nod= fish_mesh_pt()->nboundary_node(ibound);
248 for (
unsigned inod=0;inod<num_nod;inod++)
250 fish_mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
251 fish_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
257 unsigned n_element = fish_mesh_pt()->nelement();
258 for(
unsigned i=0;i<n_element;i++)
261 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(fish_mesh_pt()->element_pt(i));
270 bool i_know_what_i_am_doing=
true;
271 el_pt->evaluate_shape_derivs_by_chain_rule(i_know_what_i_am_doing);
275 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
285 template<
class ELEMENT>
293 ofstream some_file(
"RESLT/soln0.dat");
294 fish_mesh_pt()->output(some_file,npts);
310 typedef MacroElementNodeUpdateElement<QPoissonElement<2,2> >
317 problem.newton_solve();
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
FreeBoundaryPoissonProblem()
Constructor.
void doc_solution()
Doc the solution.
MyMacroElementNodeUpdateFishMesh< ELEMENT > * fish_mesh_pt()
Access function for the fish mesh.
virtual ~FreeBoundaryPoissonProblem()
Destructor (empty)
MyMacroElementNodeUpdateFishMesh< ELEMENT > * Fish_mesh_pt
Pointer to fish mesh.
void actions_before_newton_convergence_check()
Before checking the new residuals in Newton's method we have to update nodal positions in response to...
void actions_after_newton_solve()
Update the problem specs after solve (empty)
void actions_before_newton_solve()
Update the problem specs before solve (empty)
/////////////////////////////////////////////////////////////////
virtual ~MyMacroElementNodeUpdateFishMesh()
Destructor: empty.
MyMacroElementNodeUpdateFishMesh(GeomObject *back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to GeomObject that defines the fish's back and pointer to timestepper (defa...
int main()
Driver for "free-boundary" fish poisson solver with adaptation.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void get_source(const Vector< double > &x, double &source)
Const source function.