37 #include "meshes/fish_mesh.h"
41 using namespace oomph;
68 template<
class ELEMENT>
91 return dynamic_cast<RefineableFishMesh<ELEMENT>*
>(Problem::mesh_pt());
96 void doc_solution(DocInfo& doc_info);
108 template<
class ELEMENT>
114 Problem::mesh_pt()=
new RefineableFishMesh<ELEMENT>;
117 mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
123 unsigned n_bound = mesh_pt()->nboundary();
124 for(
unsigned i=0;i<n_bound;i++)
126 unsigned n_node = mesh_pt()->nboundary_node(i);
127 for (
unsigned n=0;n<n_node;n++)
130 mesh_pt()->boundary_node_pt(i,n)->pin(0);
134 mesh_pt()->boundary_node_pt(i,n)->set_value(0,0.0);
139 unsigned n_element = mesh_pt()->nelement();
140 for(
unsigned e=0;e<n_element;e++)
143 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
150 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
160 template<
class ELEMENT>
172 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
174 some_file.open(filename);
175 mesh_pt()->output(some_file,npts);
202 doc_info.set_directory(
"RESLT_incremental");
210 problem.
mesh_pt()->doc_adaptivity_targets(cout);
216 problem.newton_solve();
227 problem.refine_uniformly();
228 problem.refine_uniformly();
229 problem.refine_uniformly();
232 problem.newton_solve();
245 unsigned max_solve=4;
246 for (
unsigned isolve=0;isolve<max_solve;isolve++)
252 if ((problem.
mesh_pt()->nrefined() !=0)||
253 (problem.
mesh_pt()->nunrefined()!=0))
255 problem.newton_solve();
259 cout <<
"Mesh wasn't adapted --> we'll stop here" << std::endl;
293 doc_info.set_directory(
"RESLT_fully_automatic");
301 problem.
mesh_pt()->doc_adaptivity_targets(cout);
308 unsigned max_adapt=5;
311 problem.newton_solve(max_adapt);
Refineable Poisson problem in fish-shaped domain. Template parameter identifies the element type.
virtual ~RefineableFishPoissonProblem()
Destructor: Empty.
void actions_before_newton_solve()
Update the problem specs before solve (empty)
RefineableFishPoissonProblem()
Constructor.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
RefineableFishMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...
void doc_solution(DocInfo &doc_info)
Doc the solution. Output directory and labels are specified by DocInfo object.
void solve_with_fully_automatic_adaptation()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain with fully automatic mesh adaptatio...
void solve_with_incremental_adaptation()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain with mesh adaptation....
int main()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain with mesh adaptation.
Namespace for const source term in Poisson equation.
double Strength
Strength of source function: default value -1.0.
void source_function(const Vector< double > &x, double &source)
Const source function.