demo_drivers/mpi/distribution/hanging_node_reconciliation/adaptive_driven_cavity.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "meshes/rectangular_quadmesh.h"

Classes

class  RefineableDrivenCavityProblem< ELEMENT >
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char **argv)
 Driver for RefineableDrivenCavity test problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver for RefineableDrivenCavity test problem.

300 {
301 
302 #ifdef OOMPH_HAS_MPI
303 
304  // Initialise MPI
305  MPI_Helpers::init(argc,argv);
306 
307 #endif
308 
309  // Store command line arguments
310  CommandLineArgs::setup(argc,argv);
311 
312  // Set output directory
313  DocInfo doc_info;
314  doc_info.set_directory("RESLT");
315 
316  // Set max. number of black-box adaptation
317  unsigned max_adapt=2;
318 
319  // Solve problem with Taylor Hood elements
320  //---------------------------------------
321  {
322  //Build problem
324 
325 
326 #ifdef OOMPH_HAS_MPI
327 
328  // DocInfo object specifies directory in which we document
329  // the distribution
330  DocInfo mesh_doc_info;
331  mesh_doc_info.set_directory("RESLT_TH_MESH");
332 
333  // Create storage for pre-determined partitioning
334  const unsigned n_element=problem.mesh_pt()->nelement();
335  Vector<unsigned> element_partition(n_element);
336 
337  // Eqidistribute mesh to create non-synchronised hanging node
338  // where needed
339  for (unsigned e=0;e<8;e++)
340  {
341  element_partition[e]=0;
342  element_partition[e+8]=1;
343  }
344 
345  // Now perform the distribution and document it
346  bool report_stats=true;
347  problem.distribute(element_partition,mesh_doc_info,report_stats);
348 
349 #endif
350 
351  // solve with adaptation
352  problem.newton_solve(max_adapt);
353 
354  //Output solution
355  problem.doc_solution(doc_info);
356 
357 #ifdef OOMPH_HAS_MPI
358 
359  mesh_doc_info.number()=1;
360  problem.mesh_pt()->doc_mesh_distribution(mesh_doc_info);
361 #endif
362 
363 
364 } // end of Taylor Hood elements
365 
366 
367  // Solve problem with Crouzeix Raviart elements
368  //--------------------------------------------
369  {
370  // Build problem
372 
373 #ifdef OOMPH_HAS_MPI
374 
375  DocInfo mesh_doc_info;
376  mesh_doc_info.set_directory("RESLT_CR_MESH");
377  mesh_doc_info.number()=0;
378 
379 
380  // Eqidistribute mesh to create non-synchronised hanging node
381  // where needed
382  unsigned n_el=problem.mesh_pt()->nelement();
383  Vector<unsigned> element_partition(n_el);
384  for (unsigned e=0;e<8;e++)
385  {
386  element_partition[e]=0;
387  element_partition[e+8]=1;
388  }
389 
390  // Now perform the distribution
391  bool report_stats=true;
392  problem.distribute(element_partition,mesh_doc_info,report_stats);
393 
394 #endif
395 
396  // Re-solve with adaptation
397  problem.newton_solve(max_adapt);
398 
399  // change doc_info number
400  doc_info.number()=1;
401 
402  //Output solution
403  problem.doc_solution(doc_info);
404 
405 #ifdef OOMPH_HAS_MPI
406  mesh_doc_info.number()=1;
407  problem.mesh_pt()->doc_mesh_distribution(mesh_doc_info);
408 #endif
409 
410 
411  } // end of Crouzeix Raviart elements
412 
413 
414 // Finalise MPI
415 #ifdef OOMPH_HAS_MPI
416 
417  MPI_Helpers::finalize();
418 
419 #endif
420 
421 } // end_of_main
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Definition: demo_drivers/mpi/distribution/adaptive_driven_cavity/adaptive_driven_cavity.cc:59
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
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References e(), oomph::DocInfo::number(), problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().