35 #include "meshes/fish_mesh.h"
39 using namespace oomph;
51 void get_source(
const Vector<double>& x,
double& source)
65 template<
class ELEMENT>
88 return dynamic_cast<FishMesh<ELEMENT>*
>(Problem::mesh_pt());
93 void doc_solution(DocInfo& doc_info);
105 template<
class ELEMENT>
111 Problem::mesh_pt()=
new FishMesh<ELEMENT>;
117 unsigned num_bound = mesh_pt()->nboundary();
118 for(
unsigned ibound=0;ibound<num_bound;ibound++)
120 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
121 for (
unsigned inod=0;inod<num_nod;inod++)
124 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
128 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
133 unsigned n_element = mesh_pt()->nelement();
134 for(
unsigned i=0;i<n_element;i++)
137 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
144 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
154 template<
class ELEMENT>
166 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
168 some_file.open(filename);
169 mesh_pt()->output(some_file,npts);
194 doc_info.set_directory(
"RESLT");
204 problem.newton_solve();
Poisson problem in fish-shaped domain. Template parameter identifies the element type.
FishMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...
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.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
FishPoissonProblem()
Constructor.
virtual ~FishPoissonProblem()
Destructor: Empty.
int main()
Demonstrate how to solve 2D Poisson problem in fish-shaped domain.
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.