two_d_unsteady_heat_ALE.cc File Reference

Classes

class  MyEllipse
 
class  RefineableUnsteadyHeatProblem< ELEMENT >
 Unsteady heat problem in deformable ellipse domain. More...
 

Namespaces

 TanhSolnForUnsteadyHeat
 

Functions

double TanhSolnForUnsteadyHeat::step_position (const double &time)
 Position of step (x-axis intercept) More...
 
void TanhSolnForUnsteadyHeat::get_exact_u (const double &time, const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void TanhSolnForUnsteadyHeat::get_exact_u (const double &time, const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void TanhSolnForUnsteadyHeat::get_source (const double &time, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
void TanhSolnForUnsteadyHeat::prescribed_flux_on_fixed_y_boundary (const double &time, const Vector< double > &x, double &flux)
 Flux required by the exact solution on a boundary on which y is fixed. More...
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Demonstrate how to solve an unsteady heat problem in deformable domain with mesh adaptation. Command line arguments specify the name of the restart file.

953 {
954 
955  // Store command line arguments
956  CommandLineArgs::setup(argc,argv);
957 
958  // Build problem
961 
962  // Specify duration of the simulation
963 // double t_max=3.0;
964 
965  // Set targets for spatial adaptivity
966  problem.bulk_mesh_pt()->max_permitted_error()=0.001;
967  problem.bulk_mesh_pt()->min_permitted_error()=0.0001;
968 
969  // First timestep?
970  bool first=true;
971 
972  // Max. number of spatial adaptations per timestep. Allow plenty
973  // of adaptations at first timestep as the initial conditions
974  // can be reset "exactly" from without any interpolation error.
975  unsigned max_adapt=10;
976 
977  // Set IC
978  problem.set_initial_condition();
979 
980  // Initial timestep: Use the one used when setting up the initial
981  // condition
982  double dt=problem.time_pt()->dt();
983 
984  // If restart: The first step isn't really the first step,
985  // i.e. initial condition should not be re-set when
986  // adaptive refinement has been performed. Also, limit
987  // the max. number of refinements per timestep to the
988  // normal value straightaway.
989  if (CommandLineArgs::Argc==2)
990  {
991  first=false;
992  max_adapt=1;
993  }
994  // If no restart, refine mesh uniformly before we get started
995  else
996  {
997  problem.refine_uniformly();
998  problem.refine_uniformly();
999  }
1000 
1001  //Output solution
1002  problem.doc_solution();
1003 
1004  // find number of steps
1005  unsigned nstep = 6; //unsigned(t_max/dt);
1006 
1007  // Timestepping loop
1008  for (unsigned istep=0;istep<nstep;istep++)
1009  {
1010  // Take timestep
1011  problem.unsteady_newton_solve(dt,max_adapt,first);
1012 
1013  // Now we've done the first timestep -- don't re-set the IC
1014  // in subsequent steps
1015  first=false;
1016 
1017  // Reduce the number of spatial adaptations to one per
1018  // timestep
1019  max_adapt=1;
1020 
1021  //Output solution
1022  problem.doc_solution();
1023 
1024  }
1025 
1026 
1027 }; // end of main
Unsteady heat problem in deformable ellipse domain.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:223
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
void get_source(const double &time, const Vector< double > &x, double &source)
Source function to make it an exact solution.
Definition: optimisation/disable_ALE/unsteady_heat/two_d_unsteady_heat_adapt.cc:140
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::Argc, TanhSolnForUnsteadyHeat::get_source(), problem, and Flag_definition::setup().