36 #include "meshes/fish_mesh.h"
40 using namespace oomph;
45 template<
class ELEMENT>
47 public RefineableQuadMesh<ELEMENT>
57 &Mesh::Default_TimeStepper) :
58 FishMesh<ELEMENT>(time_stepper_pt)
62 this->setup_quadtree_forest();
65 unsigned n_element=this->nelement();
66 for (
unsigned e=0;e<n_element;e++)
69 FiniteElement* el_pt=this->finite_element_pt(e);
72 el_pt->set_macro_elem_pt(0);
95 void get_source(
const Vector<double>& x,
double& source)
109 template<
class ELEMENT>
137 void doc_solution(DocInfo& doc_info);
149 template<
class ELEMENT>
158 mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
164 unsigned num_bound = mesh_pt()->nboundary();
165 for(
unsigned ibound=0;ibound<num_bound;ibound++)
167 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
168 for (
unsigned inod=0;inod<num_nod;inod++)
171 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
175 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
180 unsigned n_element = mesh_pt()->nelement();
181 for(
unsigned i=0;i<n_element;i++)
184 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
191 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
201 template<
class ELEMENT>
213 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
215 some_file.open(filename);
216 mesh_pt()->output(some_file,npts);
243 doc_info.set_directory(
"RESLT");
251 problem.
mesh_pt()->doc_adaptivity_targets(cout);
258 problem.newton_solve();
269 problem.refine_uniformly();
270 problem.refine_uniformly();
273 problem.newton_solve();
286 unsigned max_solve=4;
287 for (
unsigned isolve=0;isolve<max_solve;isolve++)
293 if ((problem.
mesh_pt()->nrefined() !=0)||
294 (problem.
mesh_pt()->nunrefined()!=0))
296 problem.newton_solve();
300 cout <<
"Mesh wasn't adapted --> we'll stop here" << std::endl;
Fish shaped mesh with simple adaptivity (no macro elements).
virtual ~SimpleRefineableFishMesh()
Destructor: Empty.
SimpleRefineableFishMesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to timestepper (defaults to (Steady) default timestepper defined in Mesh)
Poisson problem in fish-shaped domain. Template parameter identifies the element type.
void doc_solution(DocInfo &doc_info)
Doc the solution. Output directory and labels are specified by DocInfo object.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
SimpleRefineableFishPoissonProblem()
Constructor.
virtual ~SimpleRefineableFishPoissonProblem()
Destructor: Empty.
void actions_before_newton_solve()
Update the problem specs before solve (empty)
SimpleRefineableFishMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...
int main()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain with mesh adaptation....
Namespace for const source term in Poisson equation.
void get_source(const Vector< double > &x, double &source)
Const source function.
double Strength
Strength of source function: default value -1.0.