TrilinosCouplings
Development
|
Helper functions for Poisson test problem with Intrepid + Pamgen. More...
#include <Teuchos_CommandLineProcessor.hpp>
#include <string>
Namespaces | |
IntrepidPoissonExample | |
Intrepid Poisson test problem example: common functionality. | |
Functions | |
double | TrilinosCouplings::IntrepidPoissonExample::getMaterialTensorOffDiagonalValue () |
Get off-diagonal value for material tensor. More... | |
void | TrilinosCouplings::IntrepidPoissonExample::setMaterialTensorOffDiagonalValue (const double newVal) |
Set off-diagonal value for material tensor. More... | |
std::string | TrilinosCouplings::IntrepidPoissonExample::makeMeshInput (const int nx, const int ny, const int nz) |
Make a Pamgen mesh specification for the Poisson test problem. More... | |
void | TrilinosCouplings::IntrepidPoissonExample::setCommandLineArgumentDefaults (int &nx, int &ny, int &nz, std::string &xmlInputParamsFile, std::string &solverName, bool &verbose, bool &debug) |
Set default command-line argument values for Poisson test problem. More... | |
void | TrilinosCouplings::IntrepidPoissonExample::setUpCommandLineArguments (Teuchos::CommandLineProcessor &cmdp, int &nx, int &ny, int &nz, std::string &xmlInputParamsFile, std::string &solverName, double &tol, int &maxNumIters, bool &verbose, bool &debug) |
Prepare for parsing command-line arguments. More... | |
void | TrilinosCouplings::IntrepidPoissonExample::parseCommandLineArguments (Teuchos::CommandLineProcessor &cmdp, bool &printedHelp, int argc, char *argv[], int &nx, int &ny, int &nz, std::string &xmlInputParamsFile, std::string &solverName, bool &verbose, bool &debug) |
Parse and partially validate the command-line arguments. More... | |
Helper functions for Poisson test problem with Intrepid + Pamgen.
This directory contains two versions of a Poisson test problem that uses Intrepid to generate a finite element discretization on a Pamgen-generated mesh. One version uses Epetra, and the other uses Tpetra. This header file contains utility functions that are useful for both versions.
double TrilinosCouplings::IntrepidPoissonExample::getMaterialTensorOffDiagonalValue | ( | ) |
Get off-diagonal value for material tensor.
You can use this value to control the iteration count. See the documentation of setMaterialTensorOffDiagonalValue() below for examples.
This value has to be a double, because we read it from the command line; Teuchos' facility for this stores floating-point values as double.
std::string TrilinosCouplings::IntrepidPoissonExample::makeMeshInput | ( | const int | nx, |
const int | ny, | ||
const int | nz | ||
) |
Make a Pamgen mesh specification for the Poisson test problem.
Pamgen accepts mesh descriptions as human-readable strings in a Pamgen-specific mesh description language. This function creates a mesh description for the Poisson test problem in this directory. The mesh description returned by this function describes a rectangular prism with cubic elements, with nx elements along the x dimension, ny elements along the y dimension, and nz elements along the z dimension.
void TrilinosCouplings::IntrepidPoissonExample::parseCommandLineArguments | ( | Teuchos::CommandLineProcessor & | cmdp, |
bool & | printedHelp, | ||
int | argc, | ||
char * | argv[], | ||
int & | nx, | ||
int & | ny, | ||
int & | nz, | ||
std::string & | xmlInputParamsFile, | ||
std::string & | solverName, | ||
bool & | verbose, | ||
bool & | debug | ||
) |
Parse and partially validate the command-line arguments.
printedHelp | [out] Whether the –help option was specified on the command line. |
argc | [in] Same as the argument to main(). |
argv | [in/out] Same as the argument to main(). |
All other arguments are the same as setCommandLineArgumentDefaults().
void TrilinosCouplings::IntrepidPoissonExample::setCommandLineArgumentDefaults | ( | int & | nx, |
int & | ny, | ||
int & | nz, | ||
std::string & | xmlInputParamsFile, | ||
std::string & | solverName, | ||
bool & | verbose, | ||
bool & | debug | ||
) |
Set default command-line argument values for Poisson test problem.
nx, ny, and nz mean the same thing as the input arguments of makeMeshInput().
nx | [out] Number of elements along the x dimension. |
ny | [out] Number of elements along the y dimension. |
nz | [out] Number of elements along the z dimension. |
xmlInputParamsFile | [out] Name of XML file encoding an input ParameterList for the Poisson test problem. |
solverName | [out] Name of Belos solver; anything that Belos::SolverFactory understands is valid here. |
verbose | [out] Whether to print verbose status output. |
debug | [out] Whether to print debugging output. |
void TrilinosCouplings::IntrepidPoissonExample::setMaterialTensorOffDiagonalValue | ( | const double | newVal | ) |
Set off-diagonal value for material tensor.
You can use this value to control the iteration count. The iteration counts below are for Belos' GMRES with no preconditioning, using the default problem size.
newVal = -5/4: 209 iterations (CG breaks!) newVal = -1/2: 47 iterations newVal = 0: 40 iterations (CG works) newVal = 1/2: 46 iterations newVal = 3/4: 47 iterations newVal = 1: 59 iterations newVal = 5/4: 183 iterations newVal = 3/2: 491 iterations newVal = 2: 939 iterations (CG breaks!)
void TrilinosCouplings::IntrepidPoissonExample::setUpCommandLineArguments | ( | Teuchos::CommandLineProcessor & | cmdp, |
int & | nx, | ||
int & | ny, | ||
int & | nz, | ||
std::string & | xmlInputParamsFile, | ||
std::string & | solverName, | ||
double & | tol, | ||
int & | maxNumIters, | ||
bool & | verbose, | ||
bool & | debug | ||
) |
Prepare for parsing command-line arguments.
This sets up command-line options for the given arguments, which correspond to the arguments of setCommandLineArgumentDefaults. This function reads in the default values of the arguments on input. When the command-line arguments are parsed (by parseCommandLineArguments()), their values will be overwritten with the values specified on the command line.