37 #include "meshes/fish_mesh.h"
44 using namespace oomph;
60 void get_source(
const Vector<double>& x,
double& source)
84 template<
class ELEMENT>
86 public virtual RefineableFishMesh<ELEMENT>,
87 public virtual MacroElementNodeUpdateMesh
97 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper) :
98 FishMesh<ELEMENT>(back_pt,time_stepper_pt),
99 RefineableFishMesh<ELEMENT>(time_stepper_pt)
104 unsigned n_element = this->nelement();
105 for(
unsigned i=0;i<n_element;i++)
108 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->element_pt(i));
111 Vector<GeomObject*> geom_object_pt(1);
112 geom_object_pt[0] = back_pt;
116 el_pt->set_node_update_info(geom_object_pt);
145 template<
class ELEMENT>
177 fish_mesh_pt()->node_update();
198 template<
class ELEMENT>
208 ElasticallySupportedRingElement* fish_back_pt=
209 new ElasticallySupportedRingElement(x_c,y_c,r_back);
216 add_sub_mesh(Fish_mesh_pt);
219 fish_mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
222 Fish_back_mesh_pt=
new Mesh;
227 Fish_back_mesh_pt->add_element_pt(fish_back_pt);
230 add_sub_mesh(Fish_back_mesh_pt);
240 unsigned nnod=fish_mesh_pt()->finite_element_pt(0)->nnode();
243 Node* control_node_pt=fish_mesh_pt()->finite_element_pt(0)->node_pt(nnod-1);
247 dynamic_cast<ElasticallySupportedRingElement*
>(Fish_mesh_pt->fish_back_pt())->
248 set_load_pt(control_node_pt);
253 unsigned num_bound = fish_mesh_pt()->nboundary();
254 for(
unsigned ibound=0;ibound<num_bound;ibound++)
256 unsigned num_nod= fish_mesh_pt()->nboundary_node(ibound);
257 for (
unsigned inod=0;inod<num_nod;inod++)
259 fish_mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
260 fish_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
266 unsigned n_element = fish_mesh_pt()->nelement();
267 for(
unsigned i=0;i<n_element;i++)
270 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(fish_mesh_pt()->element_pt(i));
277 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
287 template<
class ELEMENT>
295 ofstream some_file(
"RESLT/soln0.dat");
296 fish_mesh_pt()->output(some_file,npts);
312 typedef MacroElementNodeUpdateElement<RefineableQPoissonElement<2,3> >
319 problem.refine_uniformly();
320 problem.refine_uniformly();
324 unsigned max_solve=2;
325 problem.newton_solve(max_solve);
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
FreeBoundaryPoissonProblem()
Constructor.
void doc_solution()
Doc the solution.
virtual ~FreeBoundaryPoissonProblem()
Destructor (empty)
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)
Mesh * Fish_back_mesh_pt
Pointer to single-element mesh that stores the GeneralisedElement that represents the fish's back.
MyMacroElementNodeUpdateRefineableFishMesh< ELEMENT > * fish_mesh_pt()
Access function for the fish mesh.
MyMacroElementNodeUpdateRefineableFishMesh< ELEMENT > * Fish_mesh_pt
Pointer to fish mesh.
void actions_before_newton_solve()
Update the problem specs before solve (empty)
/////////////////////////////////////////////////////////////////
MyMacroElementNodeUpdateRefineableFishMesh(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...
virtual ~MyMacroElementNodeUpdateRefineableFishMesh()
Destructor: empty.
int main()
Driver for "free-boundary" fish poisson solver with adaptation.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void get_source(const Vector< double > &x, double &source)
Const source function.