41 #include "meshes/fish_mesh.h" 45 using namespace oomph;
72 template<
class ELEMENT>
95 return dynamic_cast<RefineableFishMesh<ELEMENT>*
>(Problem::mesh_pt());
100 void doc_solution(DocInfo& doc_info);
112 template<
class ELEMENT>
118 Problem::mesh_pt()=
new RefineableFishMesh<ELEMENT>;
121 mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
127 unsigned n_bound = mesh_pt()->nboundary();
128 for(
unsigned i=0;i<n_bound;i++)
130 unsigned n_node = mesh_pt()->nboundary_node(i);
131 for (
unsigned n=0;n<n_node;n++)
134 mesh_pt()->boundary_node_pt(i,n)->pin(0);
138 mesh_pt()->boundary_node_pt(i,n)->set_value(0,0.0);
143 unsigned n_element = mesh_pt()->nelement();
144 for(
unsigned e=0;e<n_element;e++)
147 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
154 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
164 template<
class ELEMENT>
176 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
178 some_file.open(filename);
179 mesh_pt()->output(some_file,npts);
206 doc_info.set_directory(
"RESLT_incremental");
214 problem.
mesh_pt()->doc_adaptivity_targets(cout);
220 problem.newton_solve();
231 problem.refine_uniformly();
232 problem.refine_uniformly();
233 problem.refine_uniformly();
236 problem.newton_solve();
249 unsigned max_solve=4;
250 for (
unsigned isolve=0;isolve<max_solve;isolve++)
256 if ((problem.
mesh_pt()->nrefined() !=0)||
257 (problem.
mesh_pt()->nunrefined()!=0))
259 problem.newton_solve();
263 cout <<
"Mesh wasn't adapted --> we'll stop here" << std::endl;
297 doc_info.set_directory(
"RESLT_fully_automatic");
305 problem.
mesh_pt()->doc_adaptivity_targets(cout);
312 unsigned max_adapt=5;
315 problem.newton_solve(max_adapt);
void solve_with_incremental_adaptation()
void solve_with_fully_automatic_adaptation()
void actions_after_newton_solve()
Update the problem specs after solve (empty)
void source_function(const Vector< double > &x, double &source)
Const source function.
double Strength
Strength of source function: default value -1.0.
RefineableFishPoissonProblem()
Constructor.
virtual ~RefineableFishPoissonProblem()
Destructor: Empty.
void actions_before_newton_solve()
Update the problem specs before solve (empty)
void doc_solution(DocInfo &doc_info)
Doc the solution. Output directory and labels are specified by DocInfo object.
Namespace for const source term in Poisson equation.
RefineableFishMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...