IFEM  90A354
AdaptiveSIM.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _ADAPTIVE_SIM_H
15 #define _ADAPTIVE_SIM_H
16 
17 #include "SIMadmin.h"
18 #include "AdaptiveSetup.h"
19 
20 
27 class AdaptiveSIM : public SIMadmin, public AdaptiveSetup
28 {
29 public:
33  explicit AdaptiveSIM(SIMoutput& sim, bool sa = true);
35  virtual ~AdaptiveSIM() {}
36 
39  bool initAdaptor(size_t normGroup = 0);
40 
46  bool solveStep(const char* inputfile, int iStep, bool withRF = false,
47  std::streamsize precision = 6);
48 
52  bool adaptMesh(int iStep, std::streamsize outPrec = 0);
53 
58  bool adaptMesh(int iStep, Vectors& sol, std::streamsize outPrec = 0);
59 
63  bool writeGlv(const char* infile, int iStep);
64 
66  const Vector& getSolution(size_t idx = 0) const { return solution[idx]; }
68  const Vector& getProjection(size_t idx = 0) const { return projs[idx]; }
70  const Vectors& getProjections() const { return projs; }
72  const Matrix& getEnorm() const { return eNorm; }
73 
77  virtual bool parse(char* keyWord, std::istream& is);
80  virtual bool parse(const tinyxml2::XMLElement* elem);
81 
86  virtual bool preprocessC(const IntVec& ignored, bool fixDup, double time0);
87 
88 protected:
90  virtual bool assembleAndSolveSystem();
91 
96  virtual bool savePoints(int iStep) const;
97 
98 private:
103 
104  int geoBlk;
105  int nBlock;
106 
107  std::vector<Vector> projs;
108  std::vector<Vector> projd;
109  std::vector<std::string> prefix;
110 
111 protected:
113 };
114 
115 #endif
std::vector< int > IntVec
General integer vector.
Definition: ASMbase.h:25
Adaptive solution setup for linear and nonlinear FEM simulators.
std::vector< Vector > Vectors
An array of real-valued vectors with algebraic operations.
Definition: MatVec.h:37
Administration base class for FEM simulators.
Adaptive solution driver for linear static FEM simulators.
Definition: AdaptiveSIM.h:28
Vectors dNorm
Dual global norms.
Definition: AdaptiveSIM.h:100
Vectors solution
All solutions (including Galerkin projections)
Definition: AdaptiveSIM.h:112
Matrix eNorm
Element norms.
Definition: AdaptiveSIM.h:101
virtual ~AdaptiveSIM()
Empty destructor.
Definition: AdaptiveSIM.h:35
virtual bool preprocessC(const IntVec &ignored, bool fixDup, double time0)
Performs some pre-processing tasks on the FE model.
Definition: AdaptiveSIM.C:41
std::vector< Vector > projs
Projected secondary solutions.
Definition: AdaptiveSIM.h:107
const Matrix & getEnorm() const
Access the calculated element-wise norms.
Definition: AdaptiveSIM.h:72
bool solveStep(const char *inputfile, int iStep, bool withRF=false, std::streamsize precision=6)
Assembles and solves the linear FE equations on current mesh.
Definition: AdaptiveSIM.C:99
AdaptiveSIM(SIMoutput &sim, bool sa=true)
The constructor initializes default adaptation parameters.
Definition: AdaptiveSIM.C:21
virtual bool parse(char *keyWord, std::istream &is)
Parses a data section from an input stream.
Definition: AdaptiveSIM.C:35
const Vectors & getProjections() const
Access all the projections.
Definition: AdaptiveSIM.h:70
std::vector< std::string > prefix
Norm prefices for VTF-output.
Definition: AdaptiveSIM.h:109
bool adaptMesh(int iStep, std::streamsize outPrec=0)
Refines the current mesh based on the element norms.
Definition: AdaptiveSIM.C:197
virtual bool assembleAndSolveSystem()
Assembles and solves the linear FE equation system.
Definition: AdaptiveSIM.C:67
Vectors gNorm
Global norms.
Definition: AdaptiveSIM.h:99
const Vector & getProjection(size_t idx=0) const
Accesses the projections.
Definition: AdaptiveSIM.h:68
int geoBlk
Running VTF geometry block counter.
Definition: AdaptiveSIM.h:104
virtual bool savePoints(int iStep) const
Saves point results to output file for a given refinement step.
Definition: AdaptiveSIM.C:278
int nBlock
Running VTF result block counter.
Definition: AdaptiveSIM.h:105
Matrix fNorm
Dual element norms.
Definition: AdaptiveSIM.h:102
bool writeGlv(const char *infile, int iStep)
Writes current mesh and results to the VTF-file.
Definition: AdaptiveSIM.C:229
bool initAdaptor(size_t normGroup=0)
Initializes the projs and prefix arrays.
Definition: AdaptiveSIM.C:47
const Vector & getSolution(size_t idx=0) const
Accesses the solution of the linear system.
Definition: AdaptiveSIM.h:66
std::vector< Vector > projd
Projected dual solutions.
Definition: AdaptiveSIM.h:108
Adaptive solution setup for linear and nonlinear FEM simulators.
Definition: AdaptiveSetup.h:36
Administration base class for FEM simulators.
Definition: SIMadmin.h:32
Sub-class with additional functionality for result output.
Definition: SIMoutput.h:33
A vector class with some added algebraic operations.
Definition: matrix.h:64