multimesh_dd_convection.cc File Reference

Classes

class  QCrouzeixRaviartElementWithTwoExternalElement< DIM >
 
class  QAdvectionDiffusionElementWithExternalElement< DIM >
 
class  DDConvectionProblem< NST_ELEMENT, AD_ELEMENT >
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char **argv)
 Driver code for 2D Boussinesq convection problem. More...
 

Variables

Vector< doubleGlobal_Physical_Variables::Direction_of_gravity (2)
 Gravity vector. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver code for 2D Boussinesq convection problem.

1068 {
1069  // Set the direction of gravity
1072 
1073  //Construct our problem
1076  problem;
1077 
1078  // Apply the boundary condition at time zero
1079  problem.set_boundary_conditions(0.0);
1080 
1081  //Perform a single steady Newton solve
1082  problem.steady_newton_solve();
1083 
1084  //Document the solution
1085  problem.doc_solution();
1086 
1087  //Start a trace file
1088  ofstream trace("RESLT/trace.dat");
1089  //Local variables for the kinetic energy and its rate of change
1090  double E=0.0, Edot = 0.0;
1091 
1092  //Output to the trace file
1093  problem.get_kinetic_energy(E,Edot);
1094  trace << problem.time_pt()->time() << " "
1095  << problem.nst_mesh_pt()->boundary_node_pt(1,8)->value(1) << " "
1096  << E << " " << Edot << std::endl;
1097 
1098  //Set the timestep
1099  double dt = 0.01;
1100 
1101  //Initialise the value of the timestep and set an impulsive start
1102  problem.assign_initial_values_impulsive(dt);
1103 
1104  //Set the number of timesteps to our default value
1105  unsigned n_steps = 2000;
1106 
1107  //If we have a command line argument, perform fewer steps
1108  //(used for self-test runs)
1109  if(argc > 1) {n_steps = 5;}
1110 
1111  //Perform n_steps timesteps
1112  for(unsigned i=0;i<n_steps;++i)
1113  {
1114  problem.unsteady_newton_solve(dt);
1115  problem.doc_solution();
1116 
1117  //Output to the trace file
1118  problem.get_kinetic_energy(E,Edot);
1119  trace << problem.time_pt()->time() << " "
1120  << problem.nst_mesh_pt()->boundary_node_pt(1,8)->value(1) << " "
1121  << E << " " << Edot << std::endl;
1122  }
1123 
1124  trace.close();
1125 } // end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: multimesh_dd_convection.cc:647
Definition: multimesh_dd_convection.cc:247
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
Vector< double > Direction_of_gravity(2)
Gravity vector.
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::Global_Physical_Variables::Direction_of_gravity, Global_Physical_Variables::E, i, and problem.