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

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

1382 {
1383 #ifdef OOMPH_HAS_MPI
1384  // Initialise MPI
1385  MPI_Helpers::init(argc,argv);
1386 
1387  // Switch off output modifier
1389 
1390  // Switch off oomph_info output for all processors but rank 0
1391  if (MPI_Helpers::communicator_pt()->my_rank()!=0)
1392  {
1394  OomphLibWarning::set_stream_pt(&oomph_nullstream);
1395  OomphLibError::set_stream_pt(&oomph_nullstream);
1396  }
1397  else
1398  {
1399  oomph_info << "\n=====================================================\n"
1400  << "Number of processors: "
1401  << MPI_Helpers::communicator_pt()->nproc()
1402  << "\n=====================================================\n"
1403  << std::endl;
1404  }
1405 #endif
1406 
1407  // Output directory
1409 
1410  // Start the timer
1411  double timer_s=TimingHelpers::timer();
1412 
1413  // Typedef the block element type
1415 
1416  // -------
1417  // TEST 1:
1418  // -------
1419  // Solve the problem using time-periodic boundary conditions.
1420  // NOTE: We can't just re-apply the boundary conditions for TEST 2 (where
1421  // we solve the initial-value problem) as applying periodic boundary
1422  // conditions involves copying nodes so we'd also have to regenerate
1423  // the mesh. It's easier just to create another Problem...
1424  {
1425  // Tell the user
1427  << "\nTest 1: Solving with time-periodic boundary conditions!"
1428  << ANSIEscapeCode::Reset << std::endl;
1429 
1430  // Use time-periodic boundary conditions
1432 
1433  // Create a Problem pointer
1435 
1436  // Solve the space-time problem
1437  problem.newton_solve();
1438 
1439  // Document the solution
1440  problem.doc_solution();
1441 
1442  // Uniform mesh refinement
1443  problem.refine_uniformly();
1444 
1445  // Solve the space-time problem
1446  problem.newton_solve();
1447 
1448  // Document the solution
1449  problem.doc_solution();
1450  } // End of TEST 1
1451 
1452  // -------
1453  // TEST 2:
1454  // -------
1455  // Solve the problem using Dirichlet boundary conditions and an initial
1456  // condition.
1457  {
1458  // Tell the user
1460  << "\nTest 2: Solving with an initial condition!"
1461  << ANSIEscapeCode::Reset << std::endl;
1462 
1463  // Reset the documentation counter
1465 
1466  // Use time-periodic boundary conditions
1468 
1469  // Create a Problem pointer
1471 
1472  // Solve the space-time problem
1473  problem.newton_solve();
1474 
1475  // Document the solution
1476  problem.doc_solution();
1477 
1478  // Uniform mesh refinement
1479  problem.refine_uniformly();
1480 
1481  // Solve the space-time problem
1482  problem.newton_solve();
1483 
1484  // Document the solution
1485  problem.doc_solution();
1486  } // End of TEST 2
1487 
1488  // Tell the user we're done
1489  oomph_info << "\n3D space-time simulation complete!"
1490  << "\nTotal time for simulation [sec]: "
1491  << TimingHelpers::timer()-timer_s << "\n" << std::endl;
1492 } // End of main
UnsteadyHeat problem.
Definition: pretend_melt.cc:80
Block preconditionable version of UnsteadyHeatSpaceTimeElement.
Definition: space_time_unsteady_heat_mixed_order_block_preconditionable_elements.h:84
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().