36 #include "meshes/fish_mesh.h"
40 using namespace oomph;
66 template<
class ELEMENT>
89 return dynamic_cast<RefineableFishMesh<ELEMENT>*
>(Problem::mesh_pt());
94 void doc_solution(DocInfo& doc_info);
106 template<
class ELEMENT>
112 Problem::mesh_pt()=
new RefineableFishMesh<ELEMENT>;
115 mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
121 unsigned num_bound = mesh_pt()->nboundary();
123 for(
unsigned ibound=0;ibound<num_bound;ibound++)
125 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
126 for (
unsigned inod=0;inod<num_nod;inod++)
129 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
133 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
138 unsigned n_element = mesh_pt()->nelement();
139 for(
unsigned i=0;i<n_element;i++)
142 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
149 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
159 template<
class ELEMENT>
171 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
173 some_file.open(filename);
174 mesh_pt()->output(some_file,npts);
201 doc_info.set_directory(
"RESLT");
209 problem.
mesh_pt()->doc_adaptivity_targets(cout);
215 problem.newton_solve();
226 unsigned n_uniform=3;
227 for (
unsigned isolve=0;isolve<n_uniform;isolve++)
231 problem.refine_uniformly();
234 problem.newton_solve();
248 unsigned max_solve=4;
249 for (
unsigned isolve=0;isolve<max_solve;isolve++)
255 if ((problem.
mesh_pt()->nrefined() !=0)||
256 (problem.
mesh_pt()->nunrefined()!=0))
258 problem.newton_solve();
262 cout <<
"Mesh wasn't adapted --> we'll stop here" << std::endl;
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_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.
void get_source(const Vector< double > &x, double &source)
Const source function.
double Strength
Strength of source function: default value -1.0.