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
27class AdaptiveSIM : public SIMadmin, public AdaptiveSetup
28{
29public:
33 explicit AdaptiveSIM(SIMoutput& sim, bool sa = true);
34
37 bool initAdaptor(size_t normGroup = 0);
38
44 bool solveStep(const char* inputfile, int iStep, bool withRF = false,
45 std::streamsize precision = 6);
46
50 bool adaptMesh(int iStep, std::streamsize outPrec = 0);
51
56 bool adaptMesh(int iStep, Vectors& sol, std::streamsize outPrec = 0);
57
61 bool writeGlv(const char* infile, int iStep);
62
64 const Vector& getSolution(size_t idx = 0) const { return solution[idx]; }
66 const Vector& getProjection(size_t idx = 0) const { return projs[idx]; }
68 const Vectors& getProjections() const { return projs; }
70 const Matrix& getEnorm() const { return eNorm; }
71
75 virtual bool parse(char* keyWord, std::istream& is);
78 virtual bool parse(const tinyxml2::XMLElement* elem);
79
84 virtual bool preprocessC(const IntVec& ignored, bool fixDup, double time0);
85
86protected:
88 virtual bool assembleAndSolveSystem();
89
94 virtual bool savePoints(int iStep) const;
95
96private:
103
104 int geoBlk;
105 int nBlock;
106
107protected:
109};
110
111#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 projs
Projected secondary solutions.
Definition AdaptiveSIM.h:97
Vectors solution
All solutions (including Galerkin projections)
Definition AdaptiveSIM.h:108
Matrix eNorm
Element norms.
Definition AdaptiveSIM.h:101
virtual bool preprocessC(const IntVec &ignored, bool fixDup, double time0)
Performs some pre-processing tasks on the FE model.
Definition AdaptiveSIM.C:41
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:92
virtual bool parse(char *keyWord, std::istream &is)
Parses a data section from an input stream.
Definition AdaptiveSIM.C:35
const Vector & getSolution(size_t idx=0) const
Accesses the solution of the linear system.
Definition AdaptiveSIM.h:64
const Matrix & getEnorm() const
Access the calculated element-wise norms.
Definition AdaptiveSIM.h:70
Vectors projd
Projected dual solutions.
Definition AdaptiveSIM.h:98
const Vectors & getProjections() const
Access all the projections.
Definition AdaptiveSIM.h:68
bool adaptMesh(int iStep, std::streamsize outPrec=0)
Refines the current mesh based on the element norms.
Definition AdaptiveSIM.C:190
virtual bool assembleAndSolveSystem()
Assembles and solves the linear FE equation system.
Definition AdaptiveSIM.C:60
Vectors gNorm
Global norms.
Definition AdaptiveSIM.h:99
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:267
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:222
bool initAdaptor(size_t normGroup=0)
Initializes the projs and projd arrays.
Definition AdaptiveSIM.C:47
const Vector & getProjection(size_t idx=0) const
Accesses the projections.
Definition AdaptiveSIM.h:66
Adaptive solution setup for linear and nonlinear FEM simulators.
Definition AdaptiveSetup.h:38
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