test_equal_order_galerkin_petrov.cc File Reference
#include "generic.h"
#include "space_time_unsteady_heat_equal_order_galerkin_petrov.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

void GlobalParameters::set_up_dof_to_block_mapping (Vector< unsigned > &dof_to_block_map)
 
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...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for unsteady heat equation.

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

1313 {
1314 #ifdef OOMPH_HAS_MPI
1315  // Initialise MPI
1316  MPI_Helpers::init(argc,argv);
1317 
1318  // Switch off output modifier
1320 
1321  // Switch off oomph_info output for all processors but rank 0
1322  if (MPI_Helpers::communicator_pt()->my_rank()!=0)
1323  {
1325  OomphLibWarning::set_stream_pt(&oomph_nullstream);
1326  OomphLibError::set_stream_pt(&oomph_nullstream);
1327  }
1328  else
1329  {
1330  oomph_info << "\n=====================================================\n"
1331  << "Number of processors: "
1332  << MPI_Helpers::communicator_pt()->nproc()
1333  << "\n=====================================================\n"
1334  << std::endl;
1335  }
1336 #endif
1337 
1338  // Output directory
1340 
1341  // Start the timer
1342  double timer_s=TimingHelpers::timer();
1343 
1344  // Typedef the block element type
1346 
1347  // -------
1348  // TEST 1:
1349  // -------
1350  // Solve the problem using time-periodic boundary conditions.
1351  // NOTE: We can't just re-apply the boundary conditions for TEST 2 (where
1352  // we solve the initial-value problem) as applying periodic boundary
1353  // conditions involves copying nodes so we'd also have to regenerate
1354  // the mesh. It's easier just to create another Problem...
1355  {
1356  // Tell the user
1358  << "\nTest 1: Solving with time-periodic boundary conditions!"
1359  << ANSIEscapeCode::Reset << std::endl;
1360 
1361  // Use time-periodic boundary conditions
1363 
1364  // Create a Problem pointer
1366 
1367  // Solve the space-time problem
1368  problem.newton_solve();
1369 
1370  // Document the solution
1371  problem.doc_solution();
1372 
1373  // Uniform mesh refinement
1374  problem.refine_uniformly();
1375 
1376  // Solve the space-time problem
1377  problem.newton_solve();
1378 
1379  // Document the solution
1380  problem.doc_solution();
1381  } // End of TEST 1
1382 
1383  // -------
1384  // TEST 2:
1385  // -------
1386  // Solve the problem using Dirichlet boundary conditions and an initial
1387  // condition.
1388  {
1389  // Tell the user
1391  << "\nTest 2: Solving with an initial condition!"
1392  << ANSIEscapeCode::Reset << std::endl;
1393 
1394  // Reset the documentation counter
1396 
1397  // Use time-periodic boundary conditions
1399 
1400  // Create a Problem pointer
1402 
1403  // Solve the space-time problem
1404  problem.newton_solve();
1405 
1406  // Document the solution
1407  problem.doc_solution();
1408 
1409  // Uniform mesh refinement
1410  problem.refine_uniformly();
1411 
1412  // Solve the space-time problem
1413  problem.newton_solve();
1414 
1415  // Document the solution
1416  problem.doc_solution();
1417  } // End of TEST 2
1418 
1419  // Tell the user we're done
1420  oomph_info << "\n3D space-time simulation complete!"
1421  << "\nTotal time for simulation [sec]: "
1422  << TimingHelpers::timer()-timer_s << "\n" << std::endl;
1423 } // End of main
UnsteadyHeat problem.
Definition: pretend_melt.cc:80
Block preconditionable version of UnsteadyHeatSpaceTimeElement.
Definition: galerkin_equal_order/space_time_unsteady_heat_block_preconditionable_elements.h:82
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
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().