OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 
52 
53 namespace oofem {
54 class Domain;
55 class Element;
56 class DofManager;
57 
62 class OOFEM_EXPORT ErrorCheckingRule
63 {
64 protected:
65  int tstep;
66  int tsubstep;
67  int number;
68  double tolerance;
69  double value;
70 
71 public:
72  ErrorCheckingRule(double tol) : tolerance(tol) {tsubstep=0;}
73 
75  virtual bool check(Domain *domain, TimeStep *tStep) = 0;
76 
77  bool checkValue(double computedValue);
78  virtual const char *giveClassName() const = 0;
79 };
80 
82 class OOFEM_EXPORT NodeErrorCheckingRule : public ErrorCheckingRule
83 {
84 protected:
85  int dofid;
87 
88 public:
89  NodeErrorCheckingRule(const std :: string &line, double tol);
90  virtual bool check(Domain *domain, TimeStep *tStep);
91  virtual const char *giveClassName() const {return "NodeErrorCheckingRule";}
92 };
93 
95 class OOFEM_EXPORT ElementErrorCheckingRule : public ErrorCheckingRule
96 {
97 protected:
98  int irule;
99  int gpnum;
102 
103 public:
104  ElementErrorCheckingRule(const std :: string &line, double tol);
105  virtual bool check(Domain *domain, TimeStep *tStep);
106  virtual const char *giveClassName() const {return "ElementErrorCheckingRule";}
107 };
108 
111 {
112 public:
115  BET_localEndForces
116  } ;
117 protected:
120 
121 public:
122  BeamElementErrorCheckingRule(const std :: string &line, double tol);
123  virtual bool check(Domain *domain, TimeStep *tStep);
124  virtual const char *giveClassName() const {return "BeamElementErrorCheckingRule";}
125 };
126 
127 
129 class OOFEM_EXPORT ReactionErrorCheckingRule : public ErrorCheckingRule
130 {
131 protected:
132  int dofid;
133 
134 public:
135  ReactionErrorCheckingRule(const std :: string &line, double tol);
136  virtual bool check(Domain *domain, TimeStep *tStep);
137  virtual const char *giveClassName() const {return "ReactionErrorCheckingRule";}
138 };
139 
142 {
143 public:
144  LoadLevelErrorCheckingRule(const std :: string &line, double tol);
145  virtual bool check(Domain *domain, TimeStep *tStep);
146  virtual const char *giveClassName() const {return "LoadLevelErrorCheckingRule";}
147 };
148 
151 {
152 public:
153  EigenValueErrorCheckingRule(const std :: string &line, double tol);
154  virtual bool check(Domain *domain, TimeStep *tStep);
155  virtual const char *giveClassName() const {return "EigenValueErrorCheckingRule";}
156 };
157 
158 
165 class OOFEM_EXPORT ErrorCheckingExportModule : public ExportModule
166 {
167 protected:
168  std :: string filename;
169  std :: vector< std :: unique_ptr< ErrorCheckingRule > > errorCheckingRules;
170  bool allPassed;
173 
174  bool scanToErrorChecks(std :: ifstream &stream, double &errorTolerance);
175  ErrorCheckingRule *giveErrorCheck(std :: ifstream &stream, double errorTolerance);
176 
177  void writeCheck(Domain *domain, TimeStep *tStep);
178 
179 public:
183  ErrorCheckingExportModule &operator=(const ErrorCheckingExportModule &) = delete;
184  virtual IRResultType initializeFrom(InputRecord *ir);
185  virtual void doOutput(TimeStep *tStep, bool forcedOutput = false);
186 
187 
188  virtual const char *giveClassName() const { return "ErrorCheckingExportModule"; }
189  virtual const char *giveInputRecordName() const { return _IFT_ErrorCheckingExportModule_Name; }
190 };
191 } // end namespace oofem
192 #endif // errorcheckingexportmodule_h_
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
#define _IFT_ErrorCheckingExportModule_Name
Checks a beam element value (in terms of end forces and and-displacements)
Class and object Domain.
Definition: domain.h:115
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual const char * giveClassName() const
Checks a reaction force value.
Checks a reaction force value.
Represents export output module - a base class for all output modules.
Definition: exportmodule.h:71
Class implementing an array of integers.
Definition: intarray.h:61
Checks error in analysis (for automatic regression tests).
virtual const char * giveClassName() const
virtual const char * giveClassName() const
virtual const char * giveClassName() const
virtual const char * giveClassName() const
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
Error checking rule used for regressions tests.
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::vector< std::unique_ptr< ErrorCheckingRule > > errorCheckingRules
virtual const char * giveInputRecordName() const
virtual const char * giveClassName() const
Class representing solution step.
Definition: timestep.h:80
virtual const char * giveClassName() const
Returns class name of the receiver.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011