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

Container for mesh adaptivity options. More...

#include <mesh_adaptivity_options.h>

Public Member Functions

 MeshAdaptivityOptions (const GetPot &input)
 
 ~MeshAdaptivityOptions ()
 
bool is_mesh_adaptive () const
 
const std::string & refinement_strategy () const
 
unsigned int max_refinement_steps () const
 
bool coarsen_by_parents () const
 
libMesh::Real absolute_global_tolerance () const
 
unsigned int nelem_target () const
 
libMesh::Real refine_fraction () const
 
libMesh::Real coarsen_fraction () const
 
libMesh::Real coarsen_threshold () const
 
bool plot_cell_errors () const
 
const std::string & error_plot_prefix () const
 
unsigned int node_level_mismatch_limit () const
 
unsigned int edge_level_mismatch_limit () const
 
unsigned int face_level_mismatch_limit () const
 
bool enforce_mismatch_limit_prior_to_refinement () const
 
unsigned int max_h_level () 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)
 
void parse_options (const GetPot &input, const std::string &section)
 

Private Attributes

bool _is_mesh_adaptive
 
std::string _refinement_strategy
 
unsigned int _max_refinement_steps
 
bool _coarsen_by_parents
 
libMesh::Real _absolute_global_tolerance
 
unsigned int _nelem_target
 
libMesh::Real _refine_fraction
 
libMesh::Real _coarsen_fraction
 
libMesh::Real _coarsen_threshold
 
bool _plot_cell_errors
 
std::string _error_plot_prefix
 
unsigned int _node_level_mismatch_limit
 
unsigned int _edge_level_mismatch_limit
 
unsigned int _face_level_mismatch_limit
 
bool _enforce_mismatch_limit_prior_to_refinement
 
unsigned int _max_h_level
 

Detailed Description

Container for mesh adaptivity options.

Definition at line 39 of file mesh_adaptivity_options.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file mesh_adaptivity_options.C.

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

37  : _is_mesh_adaptive(false),
38  _refinement_strategy("elem_fraction"),
40  _coarsen_by_parents(true),
42  _nelem_target(0),
43  _refine_fraction(0.2),
44  _coarsen_fraction(0.2),
46  _plot_cell_errors(false),
47  _error_plot_prefix("cell_error"),
52  _max_h_level(libMesh::invalid_uint)
53  {
54  this->check_dup_input_style(input);
55 
56  if( this->is_old_style(input) )
57  this->parse_old_style(input);
58  else
59  this->parse_new_style(input);
60  }
void parse_new_style(const GetPot &input)
void parse_old_style(const GetPot &input)
bool is_old_style(const GetPot &input) const
void check_dup_input_style(const GetPot &input) const
GRINS::MeshAdaptivityOptions::~MeshAdaptivityOptions ( )
inline

Definition at line 43 of file mesh_adaptivity_options.h.

43 {};

Member Function Documentation

libMesh::Real GRINS::MeshAdaptivityOptions::absolute_global_tolerance ( ) const
inline
void GRINS::MeshAdaptivityOptions::check_dup_input_style ( const GetPot &  input) const
private

Definition at line 62 of file mesh_adaptivity_options.C.

Referenced by MeshAdaptivityOptions().

63  {
64  if( input.have_variable("MeshAdaptivity") &&
65  input.have_section("Strategies/MeshAdaptivity") )
66  libmesh_error_msg("ERROR: Cannot use both old and new style of options for MeshAdaptivityOptions!");
67  }
bool GRINS::MeshAdaptivityOptions::coarsen_by_parents ( ) const
inline
libMesh::Real GRINS::MeshAdaptivityOptions::coarsen_fraction ( ) const
inline
libMesh::Real GRINS::MeshAdaptivityOptions::coarsen_threshold ( ) const
inline
unsigned int GRINS::MeshAdaptivityOptions::edge_level_mismatch_limit ( ) const
inline
bool GRINS::MeshAdaptivityOptions::enforce_mismatch_limit_prior_to_refinement ( ) const
inline
const std::string& GRINS::MeshAdaptivityOptions::error_plot_prefix ( ) const
inline
unsigned int GRINS::MeshAdaptivityOptions::face_level_mismatch_limit ( ) const
inline
bool GRINS::MeshAdaptivityOptions::is_mesh_adaptive ( ) const
inline
bool GRINS::MeshAdaptivityOptions::is_old_style ( const GetPot &  input) const
private

Definition at line 69 of file mesh_adaptivity_options.C.

Referenced by MeshAdaptivityOptions().

70  {
71  return input.have_section("MeshAdaptivity");
72  }
unsigned int GRINS::MeshAdaptivityOptions::max_h_level ( ) const
inline
unsigned int GRINS::MeshAdaptivityOptions::max_refinement_steps ( ) const
inline
unsigned int GRINS::MeshAdaptivityOptions::nelem_target ( ) const
inline
unsigned int GRINS::MeshAdaptivityOptions::node_level_mismatch_limit ( ) const
inline
void GRINS::MeshAdaptivityOptions::parse_new_style ( const GetPot &  input)
private

Definition at line 87 of file mesh_adaptivity_options.C.

References parse_options().

Referenced by MeshAdaptivityOptions().

88  {
89  std::string section = "Strategies/MeshAdaptivity";
90  this->parse_options(input,section);
91  }
void parse_options(const GetPot &input, const std::string &section)
void GRINS::MeshAdaptivityOptions::parse_old_style ( const GetPot &  input)
private

Definition at line 74 of file mesh_adaptivity_options.C.

References grins_warning, and parse_options().

Referenced by MeshAdaptivityOptions().

75  {
76  {
77  std::string warning = "WARNING: Using [MeshAdaptivity/<options>] is a DEPRECATED\n";
78  warning += " style of input for mesh adaptivity options. Please\n";
79  warning += " update to use the [Strategies/MeshAdaptivity/<options> style.\n";
80  grins_warning(warning);
81  }
82 
83  std::string section = "MeshAdaptivity";
84  this->parse_options(input,section);
85  }
#define grins_warning(message)
Definition: common.h:34
void parse_options(const GetPot &input, const std::string &section)
void GRINS::MeshAdaptivityOptions::parse_options ( const GetPot &  input,
const std::string &  section 
)
private
Todo:
PB: why aren't parsing this?

Definition at line 93 of file mesh_adaptivity_options.C.

References _absolute_global_tolerance, _coarsen_by_parents, _coarsen_fraction, _coarsen_threshold, _edge_level_mismatch_limit, _enforce_mismatch_limit_prior_to_refinement, _error_plot_prefix, _face_level_mismatch_limit, _is_mesh_adaptive, _max_h_level, _max_refinement_steps, _nelem_target, _node_level_mismatch_limit, _plot_cell_errors, _refine_fraction, and _refinement_strategy.

Referenced by parse_new_style(), and parse_old_style().

94  {
95  _is_mesh_adaptive = input(section+"/mesh_adaptive", false);
96  _refinement_strategy = input(section+"/refinement_strategy", "elem_fraction" );
97  _max_refinement_steps = input(section+"/max_refinement_steps", 0);
98  _coarsen_by_parents = true;
99  _absolute_global_tolerance = input(section+"/absolute_global_tolerance", 0);
100  _nelem_target = input(section+"/nelem_target", 0);
101  _refine_fraction = input(section+"/refine_percentage", 0.8);
102  _coarsen_fraction = input(section+"/coarsen_percentage", 0.1);
103  _coarsen_threshold = input(section+"/coarsen_threshold", 0);
104  _plot_cell_errors = input(section+"/plot_cell_errors", false);
105  _error_plot_prefix = input(section+"/error_plot_prefix", "cell_error");
106  _node_level_mismatch_limit = input(section+"/node_level_mismatch_limit", 0);
107  _edge_level_mismatch_limit = input(section+"/edge_level_mismatch_limit", 0 );
108  _face_level_mismatch_limit = input(section+"/face_level_mismatch_limit", 1 );
109  _enforce_mismatch_limit_prior_to_refinement = input(section+"/enforce_mismatch_limit_prior_to_refinement", true );
110  _max_h_level = input(section+"/max_h_level",libMesh::invalid_uint);
111  }
bool GRINS::MeshAdaptivityOptions::plot_cell_errors ( ) const
inline
libMesh::Real GRINS::MeshAdaptivityOptions::refine_fraction ( ) const
inline
const std::string& GRINS::MeshAdaptivityOptions::refinement_strategy ( ) const
inline

Member Data Documentation

libMesh::Real GRINS::MeshAdaptivityOptions::_absolute_global_tolerance
private

Definition at line 109 of file mesh_adaptivity_options.h.

Referenced by absolute_global_tolerance(), and parse_options().

bool GRINS::MeshAdaptivityOptions::_coarsen_by_parents
private

Definition at line 108 of file mesh_adaptivity_options.h.

Referenced by coarsen_by_parents(), and parse_options().

libMesh::Real GRINS::MeshAdaptivityOptions::_coarsen_fraction
private

Definition at line 112 of file mesh_adaptivity_options.h.

Referenced by coarsen_fraction(), and parse_options().

libMesh::Real GRINS::MeshAdaptivityOptions::_coarsen_threshold
private

Definition at line 113 of file mesh_adaptivity_options.h.

Referenced by coarsen_threshold(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_edge_level_mismatch_limit
private

Definition at line 118 of file mesh_adaptivity_options.h.

Referenced by edge_level_mismatch_limit(), and parse_options().

bool GRINS::MeshAdaptivityOptions::_enforce_mismatch_limit_prior_to_refinement
private
std::string GRINS::MeshAdaptivityOptions::_error_plot_prefix
private

Definition at line 115 of file mesh_adaptivity_options.h.

Referenced by error_plot_prefix(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_face_level_mismatch_limit
private

Definition at line 119 of file mesh_adaptivity_options.h.

Referenced by face_level_mismatch_limit(), and parse_options().

bool GRINS::MeshAdaptivityOptions::_is_mesh_adaptive
private

Definition at line 105 of file mesh_adaptivity_options.h.

Referenced by is_mesh_adaptive(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_max_h_level
private

Definition at line 122 of file mesh_adaptivity_options.h.

Referenced by max_h_level(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_max_refinement_steps
private

Definition at line 107 of file mesh_adaptivity_options.h.

Referenced by max_refinement_steps(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_nelem_target
private

Definition at line 110 of file mesh_adaptivity_options.h.

Referenced by nelem_target(), and parse_options().

unsigned int GRINS::MeshAdaptivityOptions::_node_level_mismatch_limit
private

Definition at line 117 of file mesh_adaptivity_options.h.

Referenced by node_level_mismatch_limit(), and parse_options().

bool GRINS::MeshAdaptivityOptions::_plot_cell_errors
private

Definition at line 114 of file mesh_adaptivity_options.h.

Referenced by parse_options(), and plot_cell_errors().

libMesh::Real GRINS::MeshAdaptivityOptions::_refine_fraction
private

Definition at line 111 of file mesh_adaptivity_options.h.

Referenced by parse_options(), and refine_fraction().

std::string GRINS::MeshAdaptivityOptions::_refinement_strategy
private

Definition at line 106 of file mesh_adaptivity_options.h.

Referenced by parse_options(), and refinement_strategy().


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

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