navier_stokes/hp_adaptive_driven_cavity/hp_adaptive_driven_cavity.cc File Reference

Classes

class  SimpleRefineableRectangularQuadMesh< ELEMENT >
 
class  PRefineableDrivenCavityProblem< 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.

282 {
283 
284  // Store command line arguments
285  CommandLineArgs::setup(argc,argv);
286 
287  // Set output directory
288  DocInfo doc_info;
289  doc_info.set_directory("RESLT");
290 
291 
292 
293  // Solve problem with hp-refineable Crouzeix Raviart elements
294  //-----------------------------------------------------------
295  // Build problem
297 
298  cout << "\n\n\nProblem self-test ";
299  if (problem.self_test()==0)
300  {
301  cout << "passed: Problem can be solved." << std::endl;
302  }
303  else
304  {
305  throw OomphLibError("Self test failed",
308  }
309 
310  if(CommandLineArgs::Argc==1)
311  {
312  problem.p_adapt();
313  problem.newton_solve();
314  doc_info.number()=1;
315  problem.doc_solution(doc_info);
316 
317  problem.adapt();
318  problem.newton_solve();
319  doc_info.number()=2;
320  problem.doc_solution(doc_info);
321 
322  problem.p_adapt();
323  problem.newton_solve();
324  doc_info.number()=3;
325  problem.doc_solution(doc_info);
326 
327  problem.adapt();
328  problem.newton_solve();
329  doc_info.number()=4;
330  problem.doc_solution(doc_info);
331 
332  problem.p_adapt();
333  problem.newton_solve();
334  doc_info.number()=5;
335  problem.doc_solution(doc_info);
336 
337  problem.adapt();
338  problem.newton_solve();
339  doc_info.number()=6;
340  problem.doc_solution(doc_info);
341 
342  problem.p_adapt();
343  problem.newton_solve();
344  doc_info.number()=7;
345  problem.doc_solution(doc_info);
346 
347  problem.adapt();
348  problem.newton_solve();
349  doc_info.number()=8;
350  problem.doc_solution(doc_info);
351  }
352  // Validation run
353  else
354  {
355  problem.refine_uniformly();
356  problem.refine_uniformly();
357  problem.newton_solve();
358  doc_info.number()=1;
359  problem.doc_solution(doc_info);
360 
361  problem.p_adapt();
362  problem.newton_solve();
363  doc_info.number()=2;
364  problem.doc_solution(doc_info);
365 
366  problem.adapt();
367  problem.newton_solve();
368  doc_info.number()=3;
369  problem.doc_solution(doc_info);
370 
371  problem.p_adapt();
372  problem.newton_solve();
373  doc_info.number()=4;
374  problem.doc_solution(doc_info);
375  }
376 
377  // Count hanging nodes
378  //cout << "Hanging nodes:" << endl;
379  unsigned num_hang=0;
380  for (unsigned n=0; n<problem.mesh_pt()->nnode(); n++)
381  {
382  if (problem.mesh_pt()->node_pt(n)->is_hanging())
383  {
384  /*
385  cout << " node " << n << " is hanging... at ("
386  << problem.mesh_pt()->node_pt(n)->x(0) << ", "
387  << problem.mesh_pt()->node_pt(n)->x(1) << ")" << endl;
388  HangInfo* hang_pt = problem.mesh_pt()->node_pt(n)->hanging_pt();
389  cout << " Nmaster = " << hang_pt->nmaster() << endl;
390  double totweight = 0.0;
391  for (unsigned nm=0; nm<hang_pt->nmaster(); nm++)
392  {
393  cout << " master node: x = (" << hang_pt->master_node_pt(nm)->x(0)
394  << ", " << hang_pt->master_node_pt(nm)->x(1) << ") w = "
395  << hang_pt->master_weight(nm) << endl;
396  totweight += hang_pt->master_weight(nm);
397  }
398  cout << " Total weights = " << totweight << endl;
399  */
400  num_hang++;
401  }
402  }
403  cout << "There were "<<num_hang<<" hanging nodes." << endl;
404 
405  // Step number
406  doc_info.number()=0;
407 
408  //Output solution
409  problem.doc_solution(doc_info);
410 
411 } // end_of_main
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: mpi/distribution/hanging_node_reconciliation/hp_adaptive_driven_cavity.cc:98
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: oomph_definitions.h:222
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::Argc, n, oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().