40 #include "meshes/fish_mesh.h" 44 using namespace oomph;
49 template<
class ELEMENT>
51 public RefineableQuadMesh<ELEMENT>
61 &Mesh::Default_TimeStepper) :
62 FishMesh<ELEMENT>(time_stepper_pt)
66 this->setup_quadtree_forest();
69 unsigned n_element=this->nelement();
70 for (
unsigned e=0;e<n_element;e++)
73 FiniteElement* el_pt=this->finite_element_pt(e);
76 el_pt->set_macro_elem_pt(0);
99 void get_source(
const Vector<double>& x,
double& source)
113 template<
class ELEMENT>
141 void doc_solution(DocInfo& doc_info);
153 template<
class ELEMENT>
162 mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
168 unsigned num_bound = mesh_pt()->nboundary();
169 for(
unsigned ibound=0;ibound<num_bound;ibound++)
171 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
172 for (
unsigned inod=0;inod<num_nod;inod++)
175 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
179 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
184 unsigned n_element = mesh_pt()->nelement();
185 for(
unsigned i=0;i<n_element;i++)
188 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
195 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
205 template<
class ELEMENT>
217 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
219 some_file.open(filename);
220 mesh_pt()->output(some_file,npts);
247 doc_info.set_directory(
"RESLT");
255 problem.
mesh_pt()->doc_adaptivity_targets(cout);
262 problem.newton_solve();
273 problem.refine_uniformly();
274 problem.refine_uniformly();
277 problem.newton_solve();
290 unsigned max_solve=4;
291 for (
unsigned isolve=0;isolve<max_solve;isolve++)
297 if ((problem.
mesh_pt()->nrefined() !=0)||
298 (problem.
mesh_pt()->nunrefined()!=0))
300 problem.newton_solve();
304 cout <<
"Mesh wasn't adapted --> we'll stop here" << std::endl;
void actions_before_newton_solve()
Update the problem specs before solve (empty)
double Strength
Strength of source function: default value -1.0.
virtual ~SimpleRefineableFishPoissonProblem()
Destructor: Empty.
void get_source(const Vector< double > &x, double &source)
Const source function.
SimpleRefineableFishMesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to timestepper (defaults to (Steady) default timestepper defined in Mesh) ...
SimpleRefineableFishPoissonProblem()
Constructor.
Fish shaped mesh with simple adaptivity (no macro elements).
void actions_after_newton_solve()
Update the problem specs after solve (empty)
virtual ~SimpleRefineableFishMesh()
Destructor: 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.
SimpleRefineableFishMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...