test_equal_order_galerkin.cc File Reference
#include "generic.h"
#include "space_time_unsteady_heat_equal_order_galerkin.h"
#include "meshes/simple_cubic_mesh.h"
#include "space_time_block_preconditioner.h"

Classes

class  UnsteadyHeatProblem< ELEMENT >
 UnsteadyHeat problem. More...
 

Namespaces

 GlobalParameters
 Global parameters.
 
 SinSolution
 Namespace for forced exact solution for UnsteadyHeat equation.
 

Functions

double GlobalParameters::round (const double &d)
 ---------------------------------------—DOCUMENTATION HELPERS---— More...
 
void SinSolution::get_exact_u (const double &t, const Vector< double > &x, Vector< double > &u)
 Exact solution as a vector. More...
 
void SinSolution::get_exact_u (const double &t, const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void SinSolution::get_source (const double &t, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
int main (int argc, char *argv[])
 Driver code for unsteady heat equation. More...
 

Variables

double GlobalParameters::L_x =1.0
 ------------------—Unsteady Heat Parameters---------------------— More...
 
double GlobalParameters::L_y =1.0
 Length of the mesh in the y-direction. More...
 
unsigned GlobalParameters::N_x =10
 Number of elements in the x-direction. More...
 
unsigned GlobalParameters::N_y =10
 Number of elements in the y-direction. More...
 
unsigned GlobalParameters::Element_order =1
 The order of the FE interpolation. More...
 
bool GlobalParameters::Apply_time_periodic_boundary_conditions =true
 Should we apply time-periodic boundary conditions? More...
 
double SinSolution::U_shift =8.0
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for unsteady heat equation.

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

995 {
996 #ifdef OOMPH_HAS_MPI
997  // Initialise MPI
998  MPI_Helpers::init(argc,argv);
999 
1000  // Switch off output modifier
1002 
1003  // Switch off oomph_info output for all processors but rank 0
1004  if (MPI_Helpers::communicator_pt()->my_rank()!=0)
1005  {
1007  OomphLibWarning::set_stream_pt(&oomph_nullstream);
1008  OomphLibError::set_stream_pt(&oomph_nullstream);
1009  }
1010  else
1011  {
1012  oomph_info << "\n=====================================================\n"
1013  << "Number of processors: "
1014  << MPI_Helpers::communicator_pt()->nproc()
1015  << "\n=====================================================\n"
1016  << std::endl;
1017  }
1018 #endif
1019 
1020  // Output directory
1022 
1023  // Start the timer
1024  double timer_s=TimingHelpers::timer();
1025 
1026  // Typedef the block element type
1028 
1029  // -------
1030  // TEST 1:
1031  // -------
1032  // Solve the problem using time-periodic boundary conditions.
1033  // NOTE: We can't just re-apply the boundary conditions for TEST 2 (where
1034  // we solve the initial-value problem) as applying periodic boundary
1035  // conditions involves copying nodes so we'd also have to regenerate
1036  // the mesh. It's easier just to create another Problem...
1037  {
1038  // Tell the user
1040  << "\nTest 1: Solving with time-periodic boundary conditions!"
1041  << ANSIEscapeCode::Reset << std::endl;
1042 
1043  // Use time-periodic boundary conditions
1045 
1046  // Create a Problem pointer
1048 
1049  // Solve the space-time problem
1050  problem.newton_solve();
1051 
1052  // Document the solution
1053  problem.doc_solution();
1054 
1055  // Take timestep
1056  problem.adapt();
1057 
1058  // Solve the space-time problem
1059  problem.newton_solve();
1060 
1061  // Document the solution
1062  problem.doc_solution();
1063  } // End of TEST 1
1064 
1065  // -------
1066  // TEST 2:
1067  // -------
1068  // Solve the problem using Dirichlet boundary conditions and an initial
1069  // condition.
1070  {
1071  // Tell the user
1073  << "\nTest 2: Solving with an initial condition!"
1074  << ANSIEscapeCode::Reset << std::endl;
1075 
1076  // Reset the documentation counter
1078 
1079  // Use time-periodic boundary conditions
1081 
1082  // Create a Problem pointer
1084 
1085  // Solve the space-time problem
1086  problem.newton_solve();
1087 
1088  // Document the solution
1089  problem.doc_solution();
1090 
1091  // Take timestep
1092  problem.adapt();
1093 
1094  // Solve the space-time problem
1095  problem.newton_solve();
1096 
1097  // Document the solution
1098  problem.doc_solution();
1099  } // End of TEST 2
1100 
1101  // Tell the user we're done
1102  oomph_info << "\n3D space-time simulation complete!"
1103  << "\nTotal time for simulation [sec]: "
1104  << TimingHelpers::timer()-timer_s << "\n" << std::endl;
1105 } // End of main
UnsteadyHeat problem.
Definition: pretend_melt.cc:80
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
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
OutputModifier *& output_modifier_pt()
Access function for the output modifier pointer.
Definition: oomph_definitions.h:476
Refineable version of 2D QUnsteadyHeatSpaceTimeElement elements.
Definition: refineable_space_time_unsteady_heat_elements.h:224
bool Apply_time_periodic_boundary_conditions
Should we apply time-periodic boundary conditions?
Definition: test_equal_order_galerkin.cc:83
DocInfo Doc_info
Helper for documenting.
Definition: extrude_triangle_generated_mesh.cc:57
void get_source(const double &t, const Vector< double > &x, double &source)
Source function to make it an exact solution.
Definition: test_equal_order_galerkin.cc:139
std::string Green
Definition: oomph_utilities.cc:72
std::string Reset
Definition: oomph_utilities.cc:77
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
Definition: oomph_definitions.cc:313
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
Definition: oomph_definitions.cc:325
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
double timer
Definition: oomph_metis_from_parmetis_3.1.1/struct.h:210
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References GlobalParameters::Apply_time_periodic_boundary_conditions, oomph::default_output_modifier, GlobalParameters::Doc_info, SinSolution::get_source(), oomph::ANSIEscapeCode::Green, oomph::DocInfo::number(), oomph::oomph_info, oomph::oomph_nullstream, oomph::OomphInfo::output_modifier_pt(), problem, oomph::ANSIEscapeCode::Reset, oomph::DocInfo::set_directory(), and oomph::OomphInfo::stream_pt().