OOFEM 3.0
Loading...
Searching...
No Matches
errorcheckingexportmodule.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef errorcheckingexportmodule_h_
36#define errorcheckingexportmodule_h_
37
38#include <vector>
39#include <memory>
40#include <fstream>
41
42#include "exportmodule.h"
43#include "valuemodetype.h"
44#include "internalstatetype.h"
45
47
48#define _IFT_ErrorCheckingExportModule_Name "errorcheck"
49#define _IFT_ErrorCheckingExportModule_filename "filename"
50#define _IFT_ErrorCheckingExportModule_writeIST "writeist"
51#define _IFT_ErrorCheckingExportModule_extractormode "extract"
53
54namespace oofem {
55class Domain;
56class Element;
57class DofManager;
58
59
65{
66protected:
67 int tstep = 0;
68 int tsubstep = 0;
69 int number = 0;
70 double tolerance = 0.;
71 double value = 0.; // expected value
72 double computedValue = 0.;
73
74public:
75 ErrorCheckingRule(double tol) : tolerance(tol) { }
76 virtual ~ErrorCheckingRule() = default;
77
79 virtual bool check(Domain *domain, TimeStep *tStep) = 0;
80 // returns the computed value (in given solution step)
81 virtual bool getValue(double& value, Domain* domain, TimeStep *tStep)=0;
82
84 virtual const char *giveClassName() const = 0;
85};
86
89{
90protected:
91 int dofid = 0;
92 ValueModeType mode = VM_Unknown;
93
94public:
95 NodeErrorCheckingRule(const std :: string &line, double tol);
96 NodeErrorCheckingRule(InputRecord& ir, double tol);
97 bool check(Domain *domain, TimeStep *tStep) override;
98 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
99 const char *giveClassName() const override { return "NodeErrorCheckingRule"; }
100};
101
104{
105protected:
106 int irule = 0;
107 int gpnum = 0;
108 InternalStateType ist = IST_Undefined;
109 int component = 0;
110
111public:
112 ElementErrorCheckingRule(const std :: string &line, double tol);
113 ElementErrorCheckingRule(InputRecord& ir, double tol);
114 bool check(Domain *domain, TimeStep *tStep) override;
115 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
116 const char *giveClassName() const override { return "ElementErrorCheckingRule"; }
117};
118
121{
122protected:
123 int idofman = 0;
124 int dofid = 0;
125 ValueModeType mode = VM_Unknown;
126
127public:
128 InternalElementDofManErrorCheckingRule(const std :: string &line, double tol);
130 bool check(Domain *domain, TimeStep *tStep) override;
131 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
132 const char *giveClassName() const override { return "InternalElementDofManErrorCheckingRule"; }
133};
134
137{
138public:
143
144protected:
146 int component = 0;
147
148public:
149 BeamElementErrorCheckingRule(const std :: string &line, double tol);
151 bool check(Domain *domain, TimeStep *tStep) override;
152 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
153 const char *giveClassName() const override { return "BeamElementErrorCheckingRule"; }
154};
155
156
159{
160protected:
161 int dofid = 0;
162
163public:
164 ReactionErrorCheckingRule(const std :: string &line, double tol);
165 ReactionErrorCheckingRule(InputRecord& ir, double tol);
166 bool check(Domain *domain, TimeStep *tStep) override;
167 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
168 const char *giveClassName() const override { return "ReactionErrorCheckingRule"; }
169};
170
173{
174public:
175 LoadLevelErrorCheckingRule(const std :: string &line, double tol);
177 bool check(Domain *domain, TimeStep *tStep) override;
178 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
179 const char *giveClassName() const override { return "LoadLevelErrorCheckingRule"; }
180};
181
184{
185public:
186 EigenValueErrorCheckingRule(const std :: string &line, double tol);
188 bool check(Domain *domain, TimeStep *tStep) override;
189 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
190 const char *giveClassName() const override { return "EigenValueErrorCheckingRule"; }
191};
192
195{
196public:
197 TimeCheckingRule(const std :: string &line, double tol);
198 TimeCheckingRule(InputRecord& ir, double tol);
199 bool check(Domain *domain, TimeStep *tStep) override;
200 bool getValue(double& value, Domain* domain, TimeStep *tStep) override;
201 const char *giveClassName() const override { return "TimeCheckingRule"; }
202};
203
204
205
213{
214protected:
215 std :: string filename;
216 std :: vector< std :: unique_ptr< ErrorCheckingRule > > errorCheckingRules;
217 bool allPassed = true;
218 bool writeChecks = false;
220 bool extractorMode = false;
221 FILE* outputFile; // for extractorMode
222
223 bool scanToErrorChecks(std :: ifstream &stream, double &errorTolerance);
224 std::unique_ptr<ErrorCheckingRule> giveErrorCheck(std :: ifstream &stream, double errorTolerance);
225
226 void writeCheck(Domain *domain, TimeStep *tStep);
227
230public:
234
235 void initialize() override;
236 void terminate() override;
237 void initializeFrom(InputRecord &ir) override;
238 void doOutput(TimeStep *tStep, bool forcedOutput = false) override;
239
240 const char *giveClassName() const override { return "ErrorCheckingExportModule"; }
242};
243} // end namespace oofem
244#endif // errorcheckingexportmodule_h_
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
const char * giveClassName() const override
BeamElementErrorCheckingRule(const std ::string &line, double tol)
bool check(Domain *domain, TimeStep *tStep) override
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
bool check(Domain *domain, TimeStep *tStep) override
EigenValueErrorCheckingRule(const std ::string &line, double tol)
const char * giveClassName() const override
bool check(Domain *domain, TimeStep *tStep) override
ElementErrorCheckingRule(const std ::string &line, double tol)
const char * giveClassName() const override
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
std::unique_ptr< ErrorCheckingRule > giveErrorCheck(std ::ifstream &stream, double errorTolerance)
const char * giveClassName() const override
Returns class name of the receiver.
void doOutput(TimeStep *tStep, bool forcedOutput=false) override
void writeCheck(Domain *domain, TimeStep *tStep)
void readRulesFromRecords(DataReader &dr, InputRecord &ir)
ErrorCheckingExportModule & operator=(const ErrorCheckingExportModule &)=delete
void initializeFrom(InputRecord &ir) override
Initializes receiver according to object description stored in input record.
std ::vector< std ::unique_ptr< ErrorCheckingRule > > errorCheckingRules
bool scanToErrorChecks(std ::ifstream &stream, double &errorTolerance)
ErrorCheckingExportModule(const ErrorCheckingExportModule &)=delete
bool checkValue(double computedValue)
virtual const char * giveClassName() const =0
virtual ~ErrorCheckingRule()=default
virtual bool check(Domain *domain, TimeStep *tStep)=0
virtual bool getValue(double &value, Domain *domain, TimeStep *tStep)=0
ExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager with number n.
bool check(Domain *domain, TimeStep *tStep) override
InternalElementDofManErrorCheckingRule(const std ::string &line, double tol)
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
const char * giveClassName() const override
LoadLevelErrorCheckingRule(const std ::string &line, double tol)
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
bool check(Domain *domain, TimeStep *tStep) override
NodeErrorCheckingRule(const std ::string &line, double tol)
bool check(Domain *domain, TimeStep *tStep) override
const char * giveClassName() const override
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
bool check(Domain *domain, TimeStep *tStep) override
const char * giveClassName() const override
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
ReactionErrorCheckingRule(const std ::string &line, double tol)
TimeCheckingRule(const std ::string &line, double tol)
bool check(Domain *domain, TimeStep *tStep) override
bool getValue(double &value, Domain *domain, TimeStep *tStep) override
const char * giveClassName() const override
#define _IFT_ErrorCheckingExportModule_Name
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011