IFEM 90A354
SIMoptions.h
Go to the documentation of this file.
1// $Id$
2//==============================================================================
12//==============================================================================
13
14#ifndef _SIM_OPTIONS_H_
15#define _SIM_OPTIONS_H_
16
17#include "ASMenums.h"
18#include "LinAlgenums.h"
19#include <string>
20#include <map>
21
22namespace utl { class LogStream; }
23namespace tinyxml2 { class XMLElement; }
24
25
37{
38public:
40 SIMoptions();
41
43 void setLinearSolver(const std::string& eqsolver);
44
46 bool parseConsoleTag(const tinyxml2::XMLElement* elem);
48 bool parseDiscretizationTag(const tinyxml2::XMLElement* elem);
50 bool parseEigSolTag(const tinyxml2::XMLElement* elem);
52 bool parseOutputTag(const tinyxml2::XMLElement* elem);
54 bool parseRestartTag(const tinyxml2::XMLElement* elem);
55
57 bool parseOldOptions(int argc, char** argv, int& i);
59 static bool ignoreOldOptions(int argc, char** argv, int& i);
60
62 bool dumpHDF5(const char* defaultName);
63
65 utl::LogStream& print(utl::LogStream& os, bool addBlankLine = false) const;
66
68 bool parseProjectionMethod(const char* ptype, int version = 1);
69
70public:
71 int nGauss[2];
72
75
78
79 // Eigenvalue solver options
80 int eig;
81 int nev;
82 int ncv;
83 double shift;
84
85 // Output options
86 int format;
87 int nViz[3];
88 int saveInc;
89 double dtSave;
90 bool pSolOnly;
91 bool saveTrac;
93 bool saveLog;
94
95 std::string hdf5;
96 std::string vtf;
97
98 // Restart options
101 std::string restartFile;
102
104 std::string log_prefix;
105
107 enum ProjectionMethod { NONE, GLOBAL, VDSA, QUASI, LEASTSQ,
108 DGL2, CGL2, CGL2_INT, SCR };
110 using ProjectionMap = std::map<ProjectionMethod,std::string>;
111
113};
114
115#endif
Various enums for assembly scope.
Various enums for linear algebra scope.
Class for encapsulation of general simulation options.
Definition SIMoptions.h:37
int ncv
Number of Arnoldi vectors.
Definition SIMoptions.h:82
bool parseRestartTag(const tinyxml2::XMLElement *elem)
Parses the restart XML-tag.
Definition SIMoptions.C:230
int saveInc
Number of load/time increments between each result output.
Definition SIMoptions.h:88
bool saveLog
If true, export the log.
Definition SIMoptions.h:93
std::string vtf
Prefix for VTF-file.
Definition SIMoptions.h:96
int format
VTF-file format (-1=NONE, 0=ASCII, 1=BINARY)
Definition SIMoptions.h:86
std::string hdf5
Prefix for HDF5-file.
Definition SIMoptions.h:95
bool parseOutputTag(const tinyxml2::XMLElement *elem)
Parses a subelement of the resultoutput XML-tag.
Definition SIMoptions.C:156
ASM::Discretization discretization
Spatial discretization option.
Definition SIMoptions.h:73
bool parseProjectionMethod(const char *ptype, int version=1)
Parses a projection method XML-tag.
Definition SIMoptions.C:389
static bool ignoreOldOptions(int argc, char **argv, int &i)
Returns true if the i'th argument is obsolete.
Definition SIMoptions.C:416
double dtSave
Time interval between each result output.
Definition SIMoptions.h:89
bool validateGroups
Flag validation of the generated threading groups.
Definition SIMoptions.h:76
bool saveTrac
If true, save gauss point traction values.
Definition SIMoptions.h:91
int printPid
PID to print info to screen for.
Definition SIMoptions.h:103
LinAlg::MatrixType solver
The linear equation solver to use.
Definition SIMoptions.h:74
void setLinearSolver(const std::string &eqsolver)
Defines the linear equation solver to be used.
Definition SIMoptions.C:65
int num_threads_SLU
Number of threads for SuperLU_MT.
Definition SIMoptions.h:77
int eig
Eigensolver method (1,...,5)
Definition SIMoptions.h:80
utl::LogStream & print(utl::LogStream &os, bool addBlankLine=false) const
Prints out the simulation options to the given stream.
Definition SIMoptions.C:423
int nViz[3]
Number of visualization points over each knot-span.
Definition SIMoptions.h:87
double shift
Eigenvalue shift.
Definition SIMoptions.h:83
ProjectionMap project
The projection methods to use.
Definition SIMoptions.h:112
std::map< ProjectionMethod, std::string > ProjectionMap
Projection method name mapping.
Definition SIMoptions.h:110
int restartInc
Number of increments between each restart output.
Definition SIMoptions.h:99
int nev
Number of eigenvalues/vectors.
Definition SIMoptions.h:81
SIMoptions()
The constructor initializes the default input options.
Definition SIMoptions.C:35
std::string restartFile
File to read restart state data from.
Definition SIMoptions.h:101
bool dumpHDF5(const char *defaultName)
Returns whether HDF5 output is requested or not.
Definition SIMoptions.C:274
std::string log_prefix
Prefix for process log files.
Definition SIMoptions.h:104
bool parseEigSolTag(const tinyxml2::XMLElement *elem)
Parses a subelement of the eigensolver XML-tag.
Definition SIMoptions.C:84
int restartStep
Index to the actual state to restart from.
Definition SIMoptions.h:100
ProjectionMethod
Enum defining the available projection methods.
Definition SIMoptions.h:107
bool parseConsoleTag(const tinyxml2::XMLElement *elem)
Parses a subelement of the console XML-tag.
Definition SIMoptions.C:242
bool pSolOnly
If true, don't save secondary solution variables.
Definition SIMoptions.h:90
bool parseOldOptions(int argc, char **argv, int &i)
Parses obsolete command-line arguments (backward compatibility).
Definition SIMoptions.C:298
bool saveNorms
If true, save element norms.
Definition SIMoptions.h:92
bool parseDiscretizationTag(const tinyxml2::XMLElement *elem)
Parses a subelement of the discretization XML-tag.
Definition SIMoptions.C:100
int nGauss[2]
Gaussian quadrature rules.
Definition SIMoptions.h:71
Logging stream class.
Definition LogStream.h:26
Discretization
Enum defining the available discretization methods.
Definition ASMenums.h:22
MatrixType
The available system matrix formats and associated solvers.
Definition LinAlgenums.h:22
General utility classes and functions.
Definition SIMoptions.h:22