46 #include "meshes/fish_mesh.h" 53 using namespace oomph;
70 void get_source(
const Vector<double>& x,
double& source)
88 template<
class ELEMENT>
106 fish_mesh_pt()->node_update();
113 fish_mesh_pt()->node_update();
129 return *Load_pt->value_pt(0);
137 fish_back_pt())->y_c();
161 Mesh* Fish_back_mesh_pt;
183 template<
class ELEMENT>
185 bool fix_position,
string directory_name) : Fix_position(fix_position)
189 Doc_info.set_directory(directory_name);
196 sprintf(filename,
"%s/trace.dat",directory_name.c_str());
199 <<
"VARIABLES=\"load\",\"y<sub>circle</sub>\",\"u<sub>control</sub>\"" 211 Fish_mesh_pt=
new MacroElementNodeUpdateRefineableFishMesh<ELEMENT>(fish_back_pt);
232 fish_mesh_pt()->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
240 unsigned nnod=
fish_mesh_pt()->finite_element_pt(0)->nnode();
246 cout << std::endl <<
"Control node is located at: " 285 for(
unsigned ibound=0;ibound<num_bound;ibound++)
287 unsigned num_nod=
fish_mesh_pt()->nboundary_node(ibound);
288 for (
unsigned inod=0;inod<num_nod;inod++)
296 for(
unsigned ibound=0;ibound<num_bound;ibound++)
299 unsigned num_nod=
fish_mesh_pt()->nboundary_node(ibound);
300 for (
unsigned inod=0;inod<num_nod;inod++)
302 fish_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
308 for(
unsigned i=0;i<n_element;i++)
311 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
fish_mesh_pt()->element_pt(i));
318 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
327 template<
class ELEMENT>
341 template<
class ELEMENT>
354 sprintf(filename,
"%s/soln%i.dat",
Doc_info.directory().c_str(),
356 some_file.open(filename);
364 fish_back_pt())->
load()
367 fish_back_pt())->
y_c()
386 template<
class ELEMENT>
391 bool fix_position=
true;
396 if (CommandLineArgs::Argc>1)
411 problem.refine_uniformly();
412 problem.refine_uniformly();
422 if (CommandLineArgs::Argc>1) nstep=1;
425 double dyc=0.6/double(nstep-1);
428 for (
unsigned istep=0;istep<nstep;istep++)
431 unsigned max_solve=2;
432 problem.newton_solve(max_solve);
449 template<
class ELEMENT>
454 bool fix_position=
false;
458 if (CommandLineArgs::Argc>1)
467 problem.refine_uniformly();
468 problem.refine_uniformly();
474 unsigned max_solve=2;
475 problem.newton_solve(max_solve);
489 int main(
int argc,
char* argv[])
493 CommandLineArgs::setup(argc,argv);
496 typedef MacroElementNodeUpdateElement<RefineableQPoissonElement<2,3> > ELEMENT;
500 demo_fish_poisson<ELEMENT>(
"RESLT");
503 demo_elastic_fish_poisson<ELEMENT>(
"RESLT_coupled");
MacroElementNodeUpdateRefineableFishMesh< ELEMENT > * Fish_mesh_pt
Pointer to fish mesh.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
RefineableFishPoissonProblem(const bool &fix_position, const string &directory_name, const unsigned &i_case)
Constructor: Bool flag specifies if position of fish back is prescribed or computed from the coupled ...
Node * Doc_node_pt
Node at which the solution of the Poisson equation is documented.
void actions_before_newton_convergence_check()
Update after Newton step: Update in response to possible changes in the wall shape.
virtual ~RefineableFishPoissonProblem()
Destructor.
double & y_c()
Return value of the vertical displacement of the ring that represents the fish's back.
double Strength
Strength of source function: default value 1.0.
MacroElementNodeUpdateRefineableFishMesh< ELEMENT > * fish_mesh_pt()
DocInfo & doc_info()
Access to DocInfo object.
void get_source(const Vector< double > &x, double &source)
Const source function.
AlgebraicRefineableFishMesh< ELEMENT > * fish_mesh_pt()
void actions_before_newton_solve()
Update the problem specs before solve: Update nodal positions.
ofstream Trace_file
Trace file.
double & load()
Return value of the "load" on the elastically supported ring that represents the fish's back...
DocInfo Doc_info
Doc info object.
bool Fix_position
Is the position of the fish back prescribed?
Data * Load_pt
Pointer to data item that stores the "load" on the fish back.
void demo_elastic_fish_poisson(const string &directory_name)
void doc_solution()
Doc the solution.
AlgebraicRefineableFishMesh< ELEMENT > * Fish_mesh_pt
Pointer to fish mesh.
void demo_fish_poisson(const string &directory_name)
int main(int argc, char *argv[])
Namespace for const source term in Poisson equation.
GeneralCircle "upgraded" to a GeneralisedElement: Circular ring whose position is given by The ring...