35 #include "meshes/fish_mesh.h"
39 using namespace oomph;
66 template<
class ELEMENT>
89 return dynamic_cast<FishMesh<ELEMENT>*
>(Problem::mesh_pt());
94 void doc_solution(DocInfo& doc_info);
106 template<
class ELEMENT>
112 Problem::mesh_pt()=
new FishMesh<ELEMENT>;
118 unsigned n_bound = mesh_pt()->nboundary();
119 for(
unsigned i=0;i<n_bound;i++)
121 unsigned n_node = mesh_pt()->nboundary_node(i);
122 for (
unsigned n=0;n<n_node;n++)
125 mesh_pt()->boundary_node_pt(i,n)->pin(0);
129 mesh_pt()->boundary_node_pt(i,n)->set_value(0,0.0);
134 unsigned n_element = mesh_pt()->nelement();
135 for(
unsigned e=0;e<n_element;e++)
138 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
145 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
155 template<
class ELEMENT>
168 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
170 some_file.open(filename);
171 mesh_pt()->output(some_file,npts);
175 sprintf(filename,
"%s/soln_nodes%i.dat",doc_info.directory().c_str(),
177 some_file.open(filename);
178 mesh_pt()->output(some_file,4);
182 sprintf(filename,
"%s/soln_fine%i.dat",doc_info.directory().c_str(),
184 some_file.open(filename);
185 mesh_pt()->output(some_file,20*npts);
190 sprintf(filename,
"%s/boundaries%i.dat",doc_info.directory().c_str(),
192 some_file.open(filename);
193 mesh_pt()->output_boundaries(some_file);
221 doc_info.set_directory(
"RESLT");
232 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.
double Strength
Strength of source function: default value -1.0.
void source_function(const Vector< double > &x, double &source)
Const source function.