41 #include "meshes/fish_mesh.h" 48 using namespace oomph;
64 void get_source(
const Vector<double>& x,
double& source)
88 template<
class ELEMENT>
90 public virtual RefineableFishMesh<ELEMENT>,
91 public virtual MacroElementNodeUpdateMesh
101 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper) :
102 FishMesh<ELEMENT>(back_pt,time_stepper_pt),
103 RefineableFishMesh<ELEMENT>(time_stepper_pt)
108 unsigned n_element = this->nelement();
109 for(
unsigned i=0;i<n_element;i++)
112 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->element_pt(i));
115 Vector<GeomObject*> geom_object_pt(1);
116 geom_object_pt[0] = back_pt;
120 el_pt->set_node_update_info(geom_object_pt);
149 template<
class ELEMENT>
181 fish_mesh_pt()->node_update();
202 template<
class ELEMENT>
220 add_sub_mesh(Fish_mesh_pt);
223 fish_mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
226 Fish_back_mesh_pt=
new Mesh;
231 Fish_back_mesh_pt->add_element_pt(fish_back_pt);
234 add_sub_mesh(Fish_back_mesh_pt);
244 unsigned nnod=fish_mesh_pt()->finite_element_pt(0)->nnode();
247 Node* control_node_pt=fish_mesh_pt()->finite_element_pt(0)->node_pt(nnod-1);
252 set_load_pt(control_node_pt);
257 unsigned num_bound = fish_mesh_pt()->nboundary();
258 for(
unsigned ibound=0;ibound<num_bound;ibound++)
260 unsigned num_nod= fish_mesh_pt()->nboundary_node(ibound);
261 for (
unsigned inod=0;inod<num_nod;inod++)
263 fish_mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
264 fish_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
270 unsigned n_element = fish_mesh_pt()->nelement();
271 for(
unsigned i=0;i<n_element;i++)
274 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(fish_mesh_pt()->element_pt(i));
281 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
291 template<
class ELEMENT>
299 ofstream some_file(
"RESLT/soln0.dat");
300 fish_mesh_pt()->output(some_file,npts);
316 typedef MacroElementNodeUpdateElement<RefineableQPoissonElement<2,3> >
323 problem.refine_uniformly();
324 problem.refine_uniformly();
328 unsigned max_solve=2;
329 problem.newton_solve(max_solve);
MyMacroElementNodeUpdateRefineableFishMesh< ELEMENT > * Fish_mesh_pt
Pointer to fish mesh.
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 ~FreeBoundaryPoissonProblem()
Destructor (empty)
MyMacroElementNodeUpdateRefineableFishMesh< ELEMENT > * fish_mesh_pt()
Access function for the 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...
FreeBoundaryPoissonProblem()
Constructor.
void get_source(const Vector< double > &x, double &source)
Const source function.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
Refineable, fish-shaped mesh with MacroElement-based node update.
int main()
Driver for "free-boundary" fish poisson solver with adaptation.
virtual ~MyMacroElementNodeUpdateRefineableFishMesh()
Destructor: empty.
Namespace for const source term in Poisson equation.
GeneralCircle "upgraded" to a GeneralisedElement: Circular ring whose position is given by The ring...
void doc_solution()
Doc the solution.
void actions_before_newton_solve()
Update the problem specs before solve (empty)