GRINS-0.8.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GRINS::ErrorEstimatorOptions Class Reference

Container for ErrorEstimator options. More...

#include <error_estimator_options.h>

Public Member Functions

 ErrorEstimatorOptions (const GetPot &input)
 
 ~ErrorEstimatorOptions ()
 
const std::string & estimator_type () const
 
bool patch_reuse () const
 
unsigned char n_adjoint_h_refinements () const
 
unsigned char n_adjoint_p_refinements () const
 
bool compute_qoi_error_estimate () const
 
bool estimator_requires_adjoint () const
 

Private Member Functions

void check_dup_input_style (const GetPot &input) const
 
bool is_old_style (const GetPot &input) const
 
void parse_old_style (const GetPot &input)
 
void parse_new_style (const GetPot &input)
 

Private Attributes

std::string _estimator_type
 
bool _patch_reuse
 
unsigned char _n_adjoint_h_refinements
 
unsigned char _n_adjoint_p_refinements
 
bool _compute_qoi_error_estimate
 

Detailed Description

Container for ErrorEstimator options.

Definition at line 37 of file error_estimator_options.h.

Constructor & Destructor Documentation

GRINS::ErrorEstimatorOptions::ErrorEstimatorOptions ( const GetPot &  input)

Definition at line 37 of file error_estimator_options.C.

References check_dup_input_style(), is_old_style(), parse_new_style(), and parse_old_style().

38  : _estimator_type("none"),
39  _patch_reuse(false),
43  {
44  this->check_dup_input_style(input);
45 
46  if( this->is_old_style(input) )
47  this->parse_old_style(input);
48  else
49  this->parse_new_style(input);
50  }
void parse_new_style(const GetPot &input)
void check_dup_input_style(const GetPot &input) const
bool is_old_style(const GetPot &input) const
void parse_old_style(const GetPot &input)
GRINS::ErrorEstimatorOptions::~ErrorEstimatorOptions ( )
inline

Definition at line 42 of file error_estimator_options.h.

42 {};

Member Function Documentation

void GRINS::ErrorEstimatorOptions::check_dup_input_style ( const GetPot &  input) const
private

Definition at line 52 of file error_estimator_options.C.

Referenced by ErrorEstimatorOptions().

53  {
54  if( input.have_section("MeshAdaptivity") &&
55  input.have_section("Strategies/ErrorEstimation") )
56  libmesh_error_msg("ERROR: Cannot use both old and new style of options for ErrorEstimator!");
57  }
bool GRINS::ErrorEstimatorOptions::compute_qoi_error_estimate ( ) const
inline
bool GRINS::ErrorEstimatorOptions::estimator_requires_adjoint ( ) const

Definition at line 89 of file error_estimator_options.C.

References _estimator_type, and GRINS::StrategiesParsing::adjoint_residual_error_estimator().

Referenced by GRINS::Simulation::check_for_adjoint_solve().

90  {
91  bool requires_adjoint = false;
94  requires_adjoint = true;
95 
96  return requires_adjoint;
97  }
static std::string adjoint_residual_error_estimator()
const std::string& GRINS::ErrorEstimatorOptions::estimator_type ( ) const
inline
bool GRINS::ErrorEstimatorOptions::is_old_style ( const GetPot &  input) const
private

Definition at line 59 of file error_estimator_options.C.

Referenced by ErrorEstimatorOptions().

60  {
61  return input.have_section("MeshAdaptivity");
62  }
unsigned char GRINS::ErrorEstimatorOptions::n_adjoint_h_refinements ( ) const
inline
unsigned char GRINS::ErrorEstimatorOptions::n_adjoint_p_refinements ( ) const
inline
void GRINS::ErrorEstimatorOptions::parse_new_style ( const GetPot &  input)
private

Definition at line 80 of file error_estimator_options.C.

References _compute_qoi_error_estimate, _estimator_type, _n_adjoint_h_refinements, _n_adjoint_p_refinements, and _patch_reuse.

Referenced by ErrorEstimatorOptions().

81  {
82  _estimator_type = input("Strategies/ErrorEstimation/estimator_type", "none");
83  _patch_reuse = input("Strategies/ErrorEstimation/patch_reuse", false);
84  _n_adjoint_h_refinements = input("Strategies/ErrorEstimation/n_adjoint_h_refinements", 1);
85  _n_adjoint_p_refinements = input("Strategies/ErrorEstimation/n_adjoint_p_refinements", 0);
86  _compute_qoi_error_estimate = input("Strategies/ErrorEstimation/compute_qoi_error_estimate", false);
87  }
void GRINS::ErrorEstimatorOptions::parse_old_style ( const GetPot &  input)
private

Definition at line 64 of file error_estimator_options.C.

References _compute_qoi_error_estimate, _estimator_type, _n_adjoint_h_refinements, _n_adjoint_p_refinements, _patch_reuse, and grins_warning.

Referenced by ErrorEstimatorOptions().

65  {
66  {
67  std::string warning = "WARNING: Using [MeshAdaptivity/<options>] is a DEPRECATED\n";
68  warning += " style of input for ErrorEstimator options. Please\n";
69  warning += " update to use the [Strategies/ErrorEstimation/<options> style.\n";
70  grins_warning(warning);
71  }
72 
73  _estimator_type = input("MeshAdaptivity/estimator_type", "none");
74  _patch_reuse = input("MeshAdaptivity/patch_reuse", false);
75  _n_adjoint_h_refinements = input("MeshAdaptivity/n_adjoint_h_refinements", 1);
76  _n_adjoint_p_refinements = input("MeshAdaptivity/n_adjoint_p_refinements", 0);
77  _compute_qoi_error_estimate = input("MeshAdaptivity/compute_qoi_error_estimate", false);
78  }
#define grins_warning(message)
Definition: common.h:34
bool GRINS::ErrorEstimatorOptions::patch_reuse ( ) const
inline

Member Data Documentation

bool GRINS::ErrorEstimatorOptions::_compute_qoi_error_estimate
private
std::string GRINS::ErrorEstimatorOptions::_estimator_type
private
unsigned char GRINS::ErrorEstimatorOptions::_n_adjoint_h_refinements
private
unsigned char GRINS::ErrorEstimatorOptions::_n_adjoint_p_refinements
private
bool GRINS::ErrorEstimatorOptions::_patch_reuse
private

Definition at line 72 of file error_estimator_options.h.

Referenced by parse_new_style(), parse_old_style(), and patch_reuse().


The documentation for this class was generated from the following files:

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1