IFEM  90A354
AdaptiveSetup.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _ADAPTIVE_SETUP_H
15 #define _ADAPTIVE_SETUP_H
16 
17 #include "MatVec.h"
18 
19 class ScalarFunc;
20 class SIMoutput;
21 namespace tinyxml2 { class XMLElement; }
22 namespace LR { struct RefineData; }
23 
24 
36 {
37 public:
41  explicit AdaptiveSetup(SIMoutput& sim, bool sa = true);
43  virtual ~AdaptiveSetup();
44 
46  void setAdaptationNorm(size_t g, size_t i = 0) { adaptor = g; adNorm = i; }
47 
50  bool initPrm(size_t normGroup);
51 
61  int calcRefinement(LR::RefineData& prm, int iStep,
62  const Vectors& gNorm, const Vector& refIn,
63  int currDofs = -1) const;
64 
68  bool parse(char* keyWord, std::istream& is);
71  bool parse(const tinyxml2::XMLElement* elem);
72 
79  void printNorms(const Vectors& gNorm, const Vectors& dNorm,
80  const Matrix& eNorm, size_t w = 36,
81  bool printModelNorms = true) const;
82 
85  bool writeMesh(int iStep) const;
86 
88  size_t eIdx() const { return eRow; }
89 
90 protected:
92 
93  size_t adaptor;
94  size_t adNorm;
95  size_t eRow;
96  double rCond;
97 
98 private:
99  bool alone;
100  bool linIndep;
101  double beta;
103  double errTol;
104  double condLimit;
105  int maxStep;
106  int maxDOFs;
107  int knot_mult;
109  double maxAspect;
110  bool closeGaps;
111  double symmEps;
112 
114  enum Threshold { NONE=0, MAXIMUM, AVERAGE, MINIMUM, TRUE_BETA,
115  DORFEL, SYMMETRIZED };
116 
118  enum RefScheme { FULLSPAN=0, MINSPAN=1,
119  ISOTROPIC_FUNCTION=2,
120  ISOTROPIC_ELEMENT=3 };
121 
124 
125  int storeMesh;
126  std::string mshPrefix;
127  std::string errPrefix;
128 };
129 
130 #endif
Global algebraic operations on index 1-based matrices and vectors.
std::vector< Vector > Vectors
An array of real-valued vectors with algebraic operations.
Definition: MatVec.h:37
Adaptive solution setup for linear and nonlinear FEM simulators.
Definition: AdaptiveSetup.h:36
std::string mshPrefix
Prefix for output files with refined meshes.
Definition: AdaptiveSetup.h:126
bool closeGaps
Split elements with a hanging node on each side.
Definition: AdaptiveSetup.h:110
size_t eIdx() const
Returns the row-index of the element norm to use for adaptation.
Definition: AdaptiveSetup.h:88
size_t adNorm
Which norm to base the mesh adaptation on.
Definition: AdaptiveSetup.h:94
RefScheme
Enum defining available refinement scheme options.
Definition: AdaptiveSetup.h:118
int maxStep
Maximum number of adaptive refinements.
Definition: AdaptiveSetup.h:105
int storeMesh
Flag telling what kind of mesh output we want.
Definition: AdaptiveSetup.h:125
int calcRefinement(LR::RefineData &prm, int iStep, const Vectors &gNorm, const Vector &refIn, int currDofs=-1) const
Calculates mesh refinement control data based on error estimates.
Definition: AdaptiveSetup.C:254
bool parse(char *keyWord, std::istream &is)
Parses a data section from an input stream.
Definition: AdaptiveSetup.C:165
bool writeMesh(int iStep) const
Dumps current mesh to external file(s) for inspection.
Definition: AdaptiveSetup.C:559
Threshold threshold
Flag for how to interpret the parameter beta.
Definition: AdaptiveSetup.h:122
bool linIndep
Test mesh for linear independence after refinement.
Definition: AdaptiveSetup.h:100
SIMoutput & model
The isogeometric FE model.
Definition: AdaptiveSetup.h:91
double errTol
Global error stop tolerance.
Definition: AdaptiveSetup.h:103
bool initPrm(size_t normGroup)
Initializes the norm group parameters.
Definition: AdaptiveSetup.C:199
void printNorms(const Vectors &gNorm, const Vectors &dNorm, const Matrix &eNorm, size_t w=36, bool printModelNorms=true) const
Prints out global norms to the log stream.
Definition: AdaptiveSetup.C:493
virtual ~AdaptiveSetup()
Empty destructor.
Definition: AdaptiveSetup.C:59
AdaptiveSetup(SIMoutput &sim, bool sa=true)
The constructor initializes default adaptation parameters.
Definition: AdaptiveSetup.C:34
Threshold
Enum defining the refinement threshold flag values.
Definition: AdaptiveSetup.h:114
std::string errPrefix
Prefix for text files with refinement indicators.
Definition: AdaptiveSetup.h:127
bool alone
If false, this class is wrapped by SIMSolver.
Definition: AdaptiveSetup.h:99
double rCond
Actual reciprocal condition number of the last mesh.
Definition: AdaptiveSetup.h:96
size_t adaptor
Norm group to base the mesh adaptation on.
Definition: AdaptiveSetup.h:93
int maxDOFs
Maximum number of degrees of freedom.
Definition: AdaptiveSetup.h:106
size_t eRow
Row-index in eNorm of the norm to use for adaptation.
Definition: AdaptiveSetup.h:95
int maxTjoints
Maximum number of hanging nodes on one element.
Definition: AdaptiveSetup.h:108
double condLimit
Upper limit on condition number.
Definition: AdaptiveSetup.h:104
ScalarFunc * betaFunc
Beta as a function.
Definition: AdaptiveSetup.h:102
double beta
Refinement percentage in each step.
Definition: AdaptiveSetup.h:101
void setAdaptationNorm(size_t g, size_t i=0)
Sets the norm group/index of the norm to base mesh adaptation on.
Definition: AdaptiveSetup.h:46
int knot_mult
Knotline multiplicity.
Definition: AdaptiveSetup.h:107
double symmEps
Epsilon used for symmetrized selection method.
Definition: AdaptiveSetup.h:111
RefScheme scheme
The actual refinement scheme to use.
Definition: AdaptiveSetup.h:123
double maxAspect
Maximum element aspect ratio.
Definition: AdaptiveSetup.h:109
Sub-class with additional functionality for result output.
Definition: SIMoutput.h:33
Scalar-valued unary function of a scalar value.
Definition: Function.h:127
A vector class with some added algebraic operations.
Definition: matrix.h:64
Utilities for LR-splines.
Definition: AdaptiveSetup.h:22
A struct of data to control the mesh refinement.
Definition: ASMunstruct.h:44