fish_poisson_node_update.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/fish_mesh.h"

Classes

class  RefineableFishPoissonProblem< ELEMENT >
 

Namespaces

 ConstSourceForPoisson
 Namespace for const source term in Poisson equation.
 

Functions

void ConstSourceForPoisson::get_source (const Vector< double > &x, double &source)
 Const source function. More...
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Demonstrate how to solve 2D Poisson problem in fish-shaped domain with black-box mesh adaptation and domain updates in response to changes in the domain shape.

198 {
199 
200  //Set up the problem with 9 node refineable Poisson elements
202 
203  // Setup labels for output
204  //------------------------
205  DocInfo doc_info;
206 
207  // Set output directory
208  doc_info.set_directory("RESLT");
209 
210  // Adjust the domain shape by changing the width of the fish
211  //----------------------------------------------------------
212  unsigned nstep=3;
213  for (unsigned i=0;i<nstep;i++)
214  {
215  // Get pointer to GeomObject that defines the position of the
216  // fish's back:
217  GeomObject* fish_back_pt=problem.mesh_pt()->fish_back_pt();
218 
219  // Recast to pointer to Circle object to get access to the member function
220  // that sets the y-position of the Circle's centre and decrease its
221  // value, making the fish narrower
222  dynamic_cast<Circle*>(fish_back_pt)->y_c()-=0.1;
223 
224  // Update the domain shape in response to the changes in its
225  // boundary
226  problem.mesh_pt()->node_update();
227 
228  // Solve the problem, allowing for up to two levels of refinement
229  problem.newton_solve(2);
230 
231  //Output solution
232  problem.doc_solution(doc_info);
233 
234  //Increment counter for solutions
235  doc_info.number()++;
236  }
237 
238 } // end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: algebraic_free_boundary_poisson.cc:81
Definition: geom_objects.h:873
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: geom_objects.h:101
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References i, oomph::DocInfo::number(), problem, and oomph::DocInfo::set_directory().