36 #include "meshes/fish_mesh.h"
40 using namespace oomph;
52 void get_source(
const Vector<double>& x,
double& source)
66 template<
class ELEMENT>
89 return dynamic_cast<RefineableFishMesh<ELEMENT>*
>(Problem::mesh_pt());
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();
122 for(
unsigned ibound=0;ibound<num_bound;ibound++)
124 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
125 for (
unsigned inod=0;inod<num_nod;inod++)
128 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
132 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
137 unsigned n_element = mesh_pt()->nelement();
138 for(
unsigned i=0;i<n_element;i++)
141 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
148 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
158 template<
class ELEMENT>
170 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
172 some_file.open(filename);
173 mesh_pt()->output(some_file,npts);
177 sprintf(filename,
"%s/boundaries%i.dat",doc_info.directory().c_str(),
179 some_file.open(filename);
180 mesh_pt()->output_boundaries(some_file);
208 doc_info.set_directory(
"RESLT");
213 for (
unsigned i=0;i<nstep;i++)
217 GeomObject* fish_back_pt=problem.
mesh_pt()->fish_back_pt();
222 dynamic_cast<Circle*
>(fish_back_pt)->y_c()-=0.1;
226 problem.
mesh_pt()->node_update();
229 problem.newton_solve(2);
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.
int main()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain with black-box mesh adaptation and ...
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.