#include <qoi_factory.h>
Definition at line 39 of file qoi_factory.h.
GRINS::QoIFactory::QoIFactory |
( |
| ) |
|
GRINS::QoIFactory::~QoIFactory |
( |
| ) |
|
|
virtual |
void GRINS::QoIFactory::add_qoi |
( |
const GetPot & |
input, |
|
|
const std::string & |
qoi_name, |
|
|
std::tr1::shared_ptr< CompositeQoI > & |
qois |
|
) |
| |
|
protectedvirtual |
std::tr1::shared_ptr< CompositeQoI > GRINS::QoIFactory::build |
( |
const GetPot & |
input | ) |
|
|
virtual |
Definition at line 48 of file qoi_factory.C.
References add_qoi(), check_qoi_physics_consistency(), echo_qoi_list(), and GRINS::StringUtilities::split_string().
50 std::string qoi_list = input(
"QoI/enabled_qois",
"none" );
52 std::vector<std::string> qoi_names;
54 if( qoi_list != std::string(
"none") )
59 std::tr1::shared_ptr<CompositeQoI> qois(
new CompositeQoI );
61 if( !qoi_names.empty() )
63 for( std::vector<std::string>::const_iterator name = qoi_names.begin();
64 name != qoi_names.end(); ++name )
66 this->
add_qoi( input, *name, qois );
71 if( input(
"screen-options/echo_qoi",
false ) )
virtual void check_qoi_physics_consistency(const GetPot &input, const std::string &qoi_name)
virtual void add_qoi(const GetPot &input, const std::string &qoi_name, std::tr1::shared_ptr< CompositeQoI > &qois)
virtual void echo_qoi_list(std::tr1::shared_ptr< CompositeQoI > &qois)
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
void GRINS::QoIFactory::check_qoi_physics_consistency |
( |
const GetPot & |
input, |
|
|
const std::string & |
qoi_name |
|
) |
| |
|
protectedvirtual |
Definition at line 112 of file qoi_factory.C.
References GRINS::avg_nusselt, consistency_helper(), GRINS::heat_transfer, and GRINS::low_mach_navier_stokes.
Referenced by build().
115 int num_physics = input.vector_variable_size(
"Physics/enabled_physics");
118 libmesh_assert(num_physics > 0);
120 std::set<std::string> requested_physics;
121 std::set<std::string> required_physics;
124 for(
int i = 0; i < num_physics; i++ )
126 requested_physics.insert( input(
"Physics/enabled_physics",
"NULL", i ) );
const std::string avg_nusselt
const PhysicsName low_mach_navier_stokes
const PhysicsName heat_transfer
void consistency_helper(const std::set< std::string > &requested_physics, const std::set< std::string > &required_physics, const std::string &qoi_name)
void GRINS::QoIFactory::consistency_error_msg |
( |
const std::string & |
qoi_name, |
|
|
const std::set< std::string > & |
required_physics |
|
) |
| |
|
protected |
Definition at line 176 of file qoi_factory.C.
Referenced by consistency_helper().
179 libMesh::err <<
"================================================================" << std::endl
180 <<
"QoI " << qoi_name << std::endl
181 <<
"requires one of the following physics which were not found:" <<std::endl;
183 for( std::set<std::string>::const_iterator name = required_physics.begin();
184 name != required_physics.end();
187 libMesh::err << *name << std::endl;
190 libMesh::err <<
"================================================================" << std::endl;
void GRINS::QoIFactory::consistency_helper |
( |
const std::set< std::string > & |
requested_physics, |
|
|
const std::set< std::string > & |
required_physics, |
|
|
const std::string & |
qoi_name |
|
) |
| |
|
protected |
Definition at line 157 of file qoi_factory.C.
References consistency_error_msg().
Referenced by check_qoi_physics_consistency().
161 bool physics_found =
false;
162 for( std::set<std::string>::const_iterator name = required_physics.begin();
163 name != required_physics.end();
166 if( requested_physics.find( (*name) ) != requested_physics.end() )
167 physics_found =
true;
void consistency_error_msg(const std::string &qoi_name, const std::set< std::string > &required_physics)
void GRINS::QoIFactory::echo_qoi_list |
( |
std::tr1::shared_ptr< CompositeQoI > & |
qois | ) |
|
|
protectedvirtual |
- Todo:
- Generalize to multiple QoI case when CompositeQoI is implemented in libMesh
Definition at line 141 of file qoi_factory.C.
Referenced by build().
144 std::cout <<
"==========================================================" << std::endl
145 <<
"List of Enabled QoIs:" << std::endl;
147 for(
unsigned int q = 0; q < qois->n_qois(); q++ )
149 std::cout << qois->get_qoi(q).name() << std::endl;
152 std::cout <<
"==========================================================" << std::endl;
The documentation for this class was generated from the following files: