Go to the source code of this file.
|
void | usage_error (const char *progname) |
|
template<typename T > |
T | assert_argument (GetPot &cl, const std::string &argname, const char *progname, const T &defaultarg) |
|
int | main (int argc, char **argv) |
|
◆ assert_argument()
template<typename T >
T assert_argument |
( |
GetPot & |
cl, |
|
|
const std::string & |
argname, |
|
|
const char * |
progname, |
|
|
const T & |
defaultarg |
|
) |
| |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 78 of file calculator.C.
82 GetPot cl(argc, argv);
86 const unsigned char requested_dim =
87 cast_int<unsigned char>(cl.follow(3,
"--dim"));
92 Mesh old_mesh(
init.comm(), requested_dim);
94 const std::string meshname =
97 old_mesh.read(meshname);
98 std::cout <<
"Mesh:" << std::endl;
99 old_mesh.print_info();
102 Mesh new_mesh(
init.comm(), requested_dim);
103 new_mesh.
read(meshname);
109 const std::string solnname =
117 if (solnname.rfind(
".xdr") < solnname.size())
119 else if (solnname.rfind(
".xda") < solnname.size())
122 libmesh_error_msg(
"Unrecognized file extension on " << solnname);
124 old_es.read(solnname, read_mode,
125 EquationSystems::READ_HEADER |
126 EquationSystems::READ_DATA |
127 EquationSystems::READ_ADDITIONAL_DATA |
128 EquationSystems::READ_BASIC_ONLY);
133 const unsigned int sysnum =
134 cl.follow(0,
"--insys");
136 libmesh_assert_less(sysnum, old_es.n_systems());
138 System & old_sys = old_es.get_system(sysnum);
146 libmesh_make_unique<SteadySolver>(new_sys);
149 cl.follow(std::string(
"LAGRANGE"),
"--family");
152 cl.follow(1,
"--order");
154 const std::string calcfunc =
159 new_sys.
goal_func = goal_function.clone();
165 solver.
quiet =
false;
172 const std::string outsolnname = cl.follow(std::string(
"out_"+solnname),
"--outsoln");
174 new_es.write(outsolnname.c_str(),
175 EquationSystems::WRITE_DATA |
176 EquationSystems::WRITE_ADDITIONAL_DATA);
177 libMesh::out <<
"Wrote solution " << outsolnname << std::endl;
References libMesh::EquationSystems::add_system(), assert_argument(), libMesh::ParsedFEMFunction< Output >::clone(), current_sys_name, libMesh::DECODE, L2System::fe_family(), L2System::fe_order(), libMesh::EquationSystems::get_system(), L2System::goal_func, libMesh::TriangleWrapper::init(), libMesh::EquationSystems::init(), L2System::input_system, libMesh::EquationSystems::n_systems(), libMesh::out, libMesh::EquationSystems::print_info(), libMesh::DiffSolver::quiet, libMesh::READ, libMesh::UnstructuredMesh::read(), libMesh::EquationSystems::read(), libMesh::EquationSystems::READ_ADDITIONAL_DATA, libMesh::EquationSystems::READ_BASIC_ONLY, libMesh::EquationSystems::READ_DATA, libMesh::EquationSystems::READ_HEADER, libMesh::DiffSolver::relative_step_tolerance, libMesh::FEMSystem::solve(), libMesh::DifferentiableSystem::time_solver, libMesh::DiffSolver::verbose, libMesh::EquationSystems::write(), libMesh::EquationSystems::WRITE_ADDITIONAL_DATA, and libMesh::EquationSystems::WRITE_DATA.
◆ usage_error()
void usage_error |
( |
const char * |
progname | ) |
|
Definition at line 46 of file calculator.C.
49 <<
" --dim d mesh dimension [default: autodetect]\n"
50 <<
" --inmesh filename input mesh file\n"
51 <<
" --insoln filename input solution file\n"
52 <<
" --calc func function to calculate\n"
53 <<
" --insys num input system number [default: 0]\n"
54 <<
" --outsoln filename output solution file [default: out_<insoln>]\n"
55 <<
" --family famname output FEM family [default: LAGRANGE]\n"
56 <<
" --order num output FEM order [default: 1]\n"
References libMesh::out.
Referenced by assert_argument().
Manages consistently variables, degrees of freedom, and coefficient vectors.
virtual void solve() override
Invokes the solver associated with the system.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
void init()
Initializes degrees of freedom on the current mesh.
std::unique_ptr< libMesh::FEMFunctionBase< libMesh::Number > > goal_func
unsigned int & fe_order()
This is a generic class that defines a solver to handle ImplicitSystem classes, including NonlinearIm...
std::unique_ptr< TimeSolver > time_solver
A pointer to the solver object we're going to use.
std::string & fe_family()
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
XdrMODE
Defines an enum for read/write mode in Xdr format.
Real relative_step_tolerance
bool verbose
The DiffSolver may print a lot more to libMesh::out if verbose is set to true; default is false.
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false) override
Reads the file specified by name.
std::string current_sys_name
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
This is the EquationSystems class.
bool quiet
The DiffSolver should not print anything to libMesh::out unless quiet is set to false; default is tru...
T assert_argument(GetPot &cl, const std::string &argname, const char *progname, const T &defaultarg)
ParsedFEMFunction provides support for FParser-based parsed functions in FEMSystem.
libMesh::System * input_system
void usage_error(const char *progname)