OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
errorcheckingexportmodule.C
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 #include <vector>
36 #include <cstdio>
37 #include <iostream>
38 
40 #include "engngm.h"
41 #include "domain.h"
42 #include "node.h"
43 #include "element.h"
44 #include "timestep.h"
45 #include "classfactory.h"
46 #include "dof.h"
47 #include "oofemtxtinputrecord.h"
48 #include "irresulttype.h"
49 #include "mathfem.h"
50 #ifdef __SM_MODULE
51  #include "../sm/EngineeringModels/structengngmodel.h"
52  #include "../sm/Elements/Beams/beam2d.h"
53  #include "../sm/Elements/Beams/beam3d.h"
54 #endif
55 
56 namespace oofem {
58 
59 
60 bool
61 ErrorCheckingRule :: checkValue(double computedValue)
62 {
63  return computedValue >= value - tolerance && computedValue <= value + tolerance;
64 }
65 
66 
67 NodeErrorCheckingRule :: NodeErrorCheckingRule(const std :: string &line, double tol) :
69 {
70 /*
71  IRResultType result;
72  char unknown;
73  std :: string kwd;
74  OOFEMTXTInputRecord rec (0, line), *ptr = &rec;
75  rec.giveRecordKeywordField(kwd);
76  if (kwd == "#NODE") {
77  IR_GIVE_FIELD (ptr,tstep, "tStep");
78  IR_GIVE_OPTIONAL_FIELD (ptr,tsubstep, "tStepVer");
79  IR_GIVE_FIELD (ptr,number, "number");
80  IR_GIVE_FIELD (ptr,dofid, "dofid");
81  IR_GIVE_FIELD (ptr,unknown, "unknown");
82  IR_GIVE_FIELD (ptr,value, "value");
83  IR_GIVE_OPTIONAL_FIELD (ptr,tolerance, "tolerance");
84  } else {
85  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
86  }
87 */
88  char unknown;
89  int ret = std :: sscanf(line.c_str(), "#NODE tStep %d number %d dof %d unknown %c value %le tolerance %le",
90  &tstep, & number, & dofid, & unknown, & value, & tolerance);
91  if ( ret < 2 ) {
92  ret = std :: sscanf(line.c_str(), "#NODE tStep %d tStepVer %d number %d dof %d unknown %c value %le tolerance %le",
93  &tstep, &tsubstep, & number, & dofid, & unknown, & value, & tolerance);
94  }
95  if ( ret < 5 ) {
96  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
97  }
98 
99  if ( unknown == 'd' ) {
100  mode = VM_Total;
101  } else if ( unknown == 'v' ) {
102  mode = VM_Velocity;
103  } else if ( unknown == 'a' ) {
104  mode = VM_Acceleration;
105  } else {
106  OOFEM_ERROR("Can't recognize unknown '%c'", unknown);
107  }
108 }
109 
110 bool
112 {
113  // Rule doesn't apply yet.
114  if ( (tStep->giveNumber() != tstep ) || (tStep->giveVersion() != tsubstep) ) {
115  return true;
116  }
117 
118  DofManager *dman = domain->giveGlobalDofManager(number);
119  if ( !dman ) {
120  if ( domain->giveEngngModel()->isParallel() ) {
121  return true;
122  } else {
123  OOFEM_WARNING("Dof manager %d not found.", number);
124  return false;
125  }
126  }
127 
128  if ( dman->giveParallelMode() == DofManager_remote || dman->giveParallelMode() == DofManager_null ) {
129  return true;
130  }
131 
132  Dof *dof = dman->giveDofWithID(dofid);
133 
134  double dmanValue = dof->giveUnknown(mode, tStep);
135  bool check = checkValue(dmanValue);
136  if ( !check ) {
137  OOFEM_WARNING("Check failed in %s: tstep %d, node %d, dof %d, mode %d:\n"
138  "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
139  domain->giveEngngModel()->giveOutputBaseFileName().c_str(), tstep, number, dofid, mode,
140  dmanValue, value, fabs(dmanValue-value), tolerance );
141  }
142  return check;
143 }
144 
145 
146 ElementErrorCheckingRule :: ElementErrorCheckingRule(const std :: string &line, double tol) :
147  ErrorCheckingRule(tol), irule(0)
148 {
149  int istnum;
150  int ret = std :: sscanf(line.c_str(), "#ELEMENT tStep %d number %d irule %d gp %d keyword %d component %d value %le tolerance %le",
151  &tstep, & number, & irule, & gpnum, & istnum, & component, & value, & tolerance);
152  if ( ret < 2 ) {
153  ret = std :: sscanf(line.c_str(), "#ELEMENT tStep %d tStepVer %d number %d irule %d gp %d keyword %d component %d value %le tolerance %le",
154  &tstep, &tsubstep, & number, & irule, & gpnum, & istnum, & component, & value, & tolerance);
155  if (ret < 4) {
156  ret = std :: sscanf(line.c_str(), "#ELEMENT tStep %d tStepVer %d number %d gp %d keyword %d component %d value %le tolerance %le",
157  &tstep, &tsubstep, & number, & gpnum, & istnum, & component, & value, & tolerance);
158  }
159  } else if ( ret < 3 ) {
160  ret = std :: sscanf(line.c_str(), "#ELEMENT tStep %d number %d gp %d keyword %d component %d value %le tolerance %le",
161  &tstep, & number, & gpnum, & istnum, & component, & value, & tolerance);
162  }
163  if ( ret < 6 ) {
164  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
165  }
166  ist = (InternalStateType)istnum;
167 }
168 
169 bool
171 {
172  // Rule doesn't apply yet.
173  if ( (tStep->giveNumber() != tstep ) || (tStep->giveVersion() != tsubstep) ) {
174  return true;
175  }
176 
177  FloatArray ipval;
178  Element *element = domain->giveGlobalElement(number);
179  if ( !element ) {
180  if ( domain->giveEngngModel()->isParallel() ) {
181  return true;
182  } else {
183  OOFEM_WARNING("Element %d not found.", number);
184  return false;
185  }
186  }
187  if ( element->giveParallelMode() != Element_local ) {
188  return true;
189  }
190 
191  // note! GPs are numbered from 0 internally, but written with 1-index, inconsistent!
193  element->giveIPValue(ipval, gp, ist, tStep);
194 
195  if ( component > ipval.giveSize() || component < 1 ) {
196  OOFEM_WARNING("Check failed in %s: element %d, gpnum %d, ist %d, component %d:\n"
197  "Component not found!",
199  ipval.printYourself();
200  return false;
201  }
202 
203  double elementValue = ipval.at(component);
204  bool check = checkValue(elementValue);
205  if ( !check ) {
206  OOFEM_WARNING("Check failed in %s: tstep %d, element %d, gpnum %d, ist %d, component %d:\n" "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
208  elementValue, value, fabs(elementValue-value), tolerance );
209  ipval.printYourself();
210  }
211  return check;
212 }
213 
214 BeamElementErrorCheckingRule :: BeamElementErrorCheckingRule(const std :: string &line, double tol) :
215  ErrorCheckingRule(tol)
216 {
217  int istnum;
218  int ret = std :: sscanf(line.c_str(), "#BEAM_ELEMENT tStep %d number %d keyword %d component %d value %le tolerance %le",
219  &tstep, & number, & istnum, & component, & value, & tolerance);
220  if ( ret < 2 ) {
221  ret = std :: sscanf(line.c_str(), "#BEAM_ELEMENT tStep %d tStepVer %d number %d keyword %d component %d value %le tolerance %le",
222  &tstep, &tsubstep, & number, & istnum, & component, & value, & tolerance);
223  }
224  if ( ret < 5 ) {
225  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
226  }
228 }
229 
230 bool
232 {
233  // Rule doesn't apply yet.
234  if ( (tStep->giveNumber() != tstep ) || (tStep->giveVersion() != tsubstep) ) {
235  return true;
236  }
237 
238  FloatArray val;
239  Element *element = domain->giveGlobalElement(number);
240  if ( !element ) {
241  if ( domain->giveEngngModel()->isParallel() ) {
242  return true;
243  } else {
244  OOFEM_WARNING("Element %d not found.", number);
245  return false;
246  }
247  }
248  if ( element->giveParallelMode() != Element_local ) {
249  return true;
250  }
251 
252  if (ist == BET_localEndDisplacement) {
253  element->computeVectorOf(VM_Total, tStep, val);
254  } else if (ist == BET_localEndForces) {
255  if(Beam2d* b = dynamic_cast<Beam2d*>(element)) b->giveEndForcesVector(val, tStep);
256  else if(Beam3d* b = dynamic_cast<Beam3d*>(element)) b->giveEndForcesVector(val, tStep);
257  else {
258  OOFEM_WARNING("Element %d has no beam interface.", number);
259  return false;
260  }
261  }
262 
263  if ( component > val.giveSize() || component < 1 ) {
264  OOFEM_WARNING("Check failed in %s: beam_element %d, ist %d, component %d:\n"
265  "Component not found!",
266  domain->giveEngngModel()->giveOutputBaseFileName().c_str(), number, ist, component);
267  val.printYourself();
268  return false;
269  }
270 
271  double elementValue = val.at(component);
272  bool check = checkValue(elementValue);
273  if ( !check ) {
274  OOFEM_WARNING("Check failed in %s: tstep %d, beam_element %d, ist %d, component %d:\n"
275  "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
277  elementValue, value, fabs(elementValue-value), tolerance );
278  val.printYourself();
279  }
280  return check;
281 }
282 
283 
284 ReactionErrorCheckingRule :: ReactionErrorCheckingRule(const std :: string &line, double tol) :
285  ErrorCheckingRule(tol)
286 {
287  int ret = std :: sscanf(line.c_str(), "#REACTION tStep %d number %d dof %d value %le tolerance %le",
288  &tstep, & number, & dofid, & value, & tolerance);
289  if ( ret < 2 ) {
290  ret = std :: sscanf(line.c_str(), "#REACTION tStep %d tStepVer %d number %d dof %d value %le tolerance %le",
291  &tstep, &tsubstep, & number, & dofid, & value, & tolerance);
292  }
293  if ( ret < 4 ) {
294  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
295  }
296 }
297 
298 bool
300 {
301  // Rule doesn't apply yet.
302  if ( (tStep->giveNumber() != tstep ) || (tStep->giveVersion() != tsubstep) ) {
303  return true;
304  }
305 
306 #ifdef __SM_MODULE
307  //EngngModel *emodel = domain->giveEngngModel();
308  StructuralEngngModel *emodel = static_cast< StructuralEngngModel* >( domain->giveEngngModel() );
311  //std :: map< int, std :: map< int, double > > reactionForces; // reactionForces[nodeNumber][dofid] like this
312  //emodel->computeReaction(std :: reactionForces, tStep, domain->giveNumber());
313  FloatArray reactionForces;
314  IntArray restrDofMans, restrDofs, eqn;
315  emodel->buildReactionTable(restrDofMans, restrDofs, eqn, tStep, domain->giveNumber());
316  emodel->computeReaction(reactionForces, tStep, domain->giveNumber());
317 
318  bool found = false;
319  int index;
320  for ( index = 1; index <= restrDofs.giveSize(); ++index ) {
321  if ( restrDofs.at(index) == dofid && domain->giveNode(restrDofMans.at(index))->giveLabel() == number ) {
322  found = true;
323  break;
324  }
325  }
326  if ( !found ) {
327  if ( domain->giveEngngModel()->isParallel() ) {
328  return true;
329  } else {
330  OOFEM_WARNING("Reaction force node: %d dof: %d not found.", number, dofid);
331  return false;
332  }
333  }
334 
335  double reactionForce = reactionForces.at(index);
336  bool check = checkValue(reactionForce);
337  if ( !check ) {
338  OOFEM_WARNING("Check failed in %s: tstep %d, reaction forces number %d, dof %d:\n"
339  "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
340  domain->giveEngngModel()->giveOutputBaseFileName().c_str(), tstep, number, dofid,
341  reactionForce, value, fabs(reactionForce-value), tolerance );
342  }
343  return check;
344 #else
345  OOFEM_WARNING("Reaction forces only supported for structural problems yet");
346  return false;
347 #endif
348 }
349 
350 
351 LoadLevelErrorCheckingRule :: LoadLevelErrorCheckingRule(const std :: string &line, double tol) :
352  ErrorCheckingRule(tol)
353 {
354  int ret = std :: sscanf(line.c_str(), "#LOADLEVEL tStep %d value %le tolerance %le",
355  &tstep, & value, & tolerance);
356  if ( ret < 2 ) {
357  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
358  }
359 }
360 
361 
362 bool
364 {
365  // Rule doesn't apply yet.
366  if ( tStep->giveNumber() != tstep ) {
367  return true;
368  }
369 
370  double loadLevel = domain->giveEngngModel()->giveLoadLevel();
371  bool check = checkValue(loadLevel);
372  if ( !check ) {
373  OOFEM_WARNING("Check failed in %s: tstep %d, load level:\n"
374  "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
375  domain->giveEngngModel()->giveOutputBaseFileName().c_str(), tstep,
376  loadLevel, value, fabs(loadLevel-value), tolerance );
377  }
378  return check;
379 }
380 
381 
382 EigenValueErrorCheckingRule :: EigenValueErrorCheckingRule(const std :: string &line, double tol) :
383  ErrorCheckingRule(tol)
384 {
385  int ret = std :: sscanf(line.c_str(), "#EIGVAL tStep %d EigNum %d value %le tolerance %le",
386  &tstep, & number, & value, & tolerance);
387  if ( ret < 3 ) {
388  OOFEM_ERROR("Something wrong in the error checking rule: %s\n", line.c_str());
389  }
390 }
391 
392 bool
394 {
395  // Rule doesn't apply yet.
396  if ( tStep->giveNumber() != tstep ) {
397  return true;
398  }
399 
400  double eig = domain->giveEngngModel()->giveEigenValue(number);
401  bool check = checkValue(eig);
402  if ( !check ) {
403  OOFEM_WARNING("Check failed in %s: tstep %d, eigen value %d:\n"
404  "value is %.8e, but should be %.8e ( error is %e but tolerance is %e )",
405  domain->giveEngngModel()->giveOutputBaseFileName().c_str(), tstep, number,
406  eig, value, fabs(eig-value), tolerance );
407  }
408  return check;
409 }
410 
411 
413 
414 
416 {
417  allPassed = true;
418  writeChecks = false;
419 }
420 
423 {
424  IRResultType result; // Required by IR_GIVE_FIELD macro
425 
426  allPassed = true;
427  this->errorCheckingRules.clear();
428 
429  filename = std::string("");
430 
433  }
434  else {
436  }
437 
438  // Reads all the rules;
439  std :: ifstream inputStream(this->filename);
440  if ( !inputStream ) {
441  OOFEM_WARNING("Couldn't open file '%s'\n", this->filename.c_str());
442  return IRRT_BAD_FORMAT;
443  }
444  double tol = 0.;
445  if ( this->scanToErrorChecks(inputStream, tol) ) {
446  for (;;) {
447  std :: unique_ptr< ErrorCheckingRule > rule(this->giveErrorCheck(inputStream, tol));
448  if ( !rule ) {
449  break;
450  }
451  errorCheckingRules.push_back(std :: move(rule));
452  }
453  }
454 
455  this->writeIST.clear();
457  if ( writeChecks ) {
459  }
460 
461  if ( errorCheckingRules.size() == 0 && !writeChecks ) {
462  OOFEM_WARNING("No rules found (possibly wrong file or syntax).");
463  }
464 
466 }
467 
468 void
470 {
471 #if 0
472  if ( !( testTimeStepOutput(tStep) || forcedOutput ) ) {
473  return;
474  }
475 #endif
476 
477  // Error checking rules are hardcoded to domain 1 always.
478  Domain *domain = emodel->giveDomain(1);
479 
480  OOFEM_LOG_INFO("Checking rules...\n");
481  for ( auto &rule: this->errorCheckingRules ) {
482  this->allPassed &= rule->check(domain, tStep);
483  }
484 
485  if ( !tStep->isNotTheLastStep() ) {
486  if ( !this->allPassed ) {
487  OOFEM_ERROR("Rule not passed, exiting with error");
488  }
489  }
490 
491  if ( this->writeChecks ) {
492  this->writeCheck(domain, tStep);
493  }
494 }
495 
496 
497 void
499 {
500  if ( tStep->isTheFirstStep() ) {
501  std :: cout << "#%BEGIN_CHECK% tolerance 1.e-3\n";
502  }
503 
504  for ( auto &dman : domain->giveDofManagers() ) {
505  for ( Dof *dof: *dman ) {
506  if ( dof->giveEqn() < 0 ) {
507  continue;
508  }
509  std :: cout << "#NODE tStep " << tStep->giveNumber();
510  std :: cout << " number " << dman->giveNumber();
511  std :: cout << " dof " << dof->giveDofID();
512  std :: cout << " unknown " << 'd';
513  std :: cout << " value " << dof->giveUnknown(VM_Total, tStep);
514  std :: cout << std :: endl;
515  }
516  }
517 
518  for ( auto &element : domain->giveElements() ) {
519  IntegrationRule *iRule = element->giveDefaultIntegrationRulePtr();
520  FloatArray ipval;
521  for ( int ist: this->writeIST ) {
522  for ( int gpnum = 0; gpnum < iRule->giveNumberOfIntegrationPoints(); ++gpnum ){
523  GaussPoint *gp = iRule->getIntegrationPoint(gpnum);
524  element->giveIPValue(ipval, gp, (InternalStateType)ist, tStep);
525  for ( int component = 1; component <= ipval.giveSize(); ++component ) {
526  std :: cout << "#ELEMENT tStep " << tStep->giveNumber();
527  std :: cout << " number " << element->giveNumber();
528  std :: cout << " gp " << gpnum+1;
529  std :: cout << " keyword " << ist;
530  std :: cout << " component " << component;
531  std :: cout << " value " << ipval.at(component);
532  std :: cout << std :: endl;
533  }
534  }
535  }
536  }
537 
538  if ( !tStep->isNotTheLastStep() ) {
539  std :: cout << "#%END_CHECK%" << std :: endl;
540  }
541 }
542 
543 
544 bool
545 ErrorCheckingExportModule :: scanToErrorChecks(std :: ifstream &stream, double &errorTolerance)
546 {
547  while ( !stream.eof() ) {
548  std :: string line;
549  std :: getline(stream, line);
550  if ( line.compare(0, 14, "#%BEGIN_CHECK%") == 0 ) {
551  errorTolerance = 1e-6;
552  if ( line.size() >= 25 ) {
553  errorTolerance = std :: stod( line.substr(25) );
554  }
555  return true;
556  }
557  }
558  return false;
559 }
560 
562 ErrorCheckingExportModule :: giveErrorCheck(std :: ifstream &stream, double errorTolerance)
563 {
564  std :: string line;
565  while ( !stream.eof() ) {
566  std :: getline(stream, line);
567  if ( line.compare(0, 12, "#%END_CHECK%") == 0 ) {
568  return NULL;
569  }
570  if ( line.size() > 2 && line[0] == '#' && line[1] != '#' ) {
571  break;
572  }
573  }
574 
575  if ( line.compare(0, 5, "#NODE") == 0 ) {
576  return new NodeErrorCheckingRule(line, errorTolerance);
577  } else if ( line.compare(0, 8, "#ELEMENT") == 0 ) {
578  return new ElementErrorCheckingRule(line, errorTolerance);
579  } else if ( line.compare(0, 13, "#BEAM_ELEMENT") == 0 ) {
580  return new BeamElementErrorCheckingRule(line, errorTolerance);
581  } else if ( line.compare(0, 9, "#REACTION") == 0 ) {
582  return new ReactionErrorCheckingRule(line, errorTolerance);
583  } else if ( line.compare(0, 10, "#LOADLEVEL") == 0 ) {
584  return new LoadLevelErrorCheckingRule(line, errorTolerance);
585  } else if ( line.compare(0, 7, "#EIGVAL") == 0 ) {
586  return new EigenValueErrorCheckingRule(line, errorTolerance);
587  } else {
588  OOFEM_ERROR("Unsupported rule '%s'", line.c_str());
589  return NULL;
590  }
591 }
592 
593 } // end namespace oofem
bool scanToErrorChecks(std::ifstream &stream, double &errorTolerance)
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Checks a beam element value (in terms of end forces and and-displacements)
bool testTimeStepOutput(TimeStep *tStep)
Tests if given time step output is required.
Definition: exportmodule.C:148
DofManager in active domain is shared only by remote elements (these are only introduced for nonlocal...
Definition: dofmanager.h:88
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
LoadLevelErrorCheckingRule(const std::string &line, double tol)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Definition: element.C:1257
std::string giveOutputBaseFileName()
Returns base output file name to which extensions, like .out .vtu .osf should be added.
Definition: engngm.h:363
Class and object Domain.
Definition: domain.h:115
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
virtual IntegrationRule * giveIntegrationRule(int i)
Definition: element.h:835
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep)=0
The key method of class Dof.
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
This class implements a 2-dimensional beam element with cubic lateral displacement, quadratic rotations, and linear longitudinal displacements and geometry.
Definition: beam2d.h:62
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
bool isParallel() const
Returns true if receiver in parallel mode.
Definition: engngm.h:1056
Abstract base class for all finite elements.
Definition: element.h:145
Base class for dof managers.
Definition: dofmanager.h:113
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
Definition: domain.h:400
#define _IFT_ErrorCheckingExportModule_filename
Filename where rules are defined (normally the input file).
Checks a reaction force value.
int giveNumber()
Returns domain number.
Definition: domain.h:266
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
Checks error in analysis (for automatic regression tests).
Abstract base class representing integration rule.
bool isTheFirstStep()
Check if receiver is first step.
Definition: timestep.C:134
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
void buildReactionTable(IntArray &restrDofMans, IntArray &restrDofs, IntArray &eqn, TimeStep *tStep, int di)
Builds the reaction force table.
NodeErrorCheckingRule(const std::string &line, double tol)
#define OOFEM_LOG_INFO(...)
Definition: logger.h:127
int giveNumber()
Returns receiver&#39;s number.
Definition: timestep.h:129
#define OOFEM_ERROR(...)
Definition: error.h:61
void clear()
Clears the array (zero size).
Definition: intarray.h:177
EngngModel * emodel
Problem pointer.
Definition: exportmodule.h:77
std::string giveReferenceFileName()
Returns reference file name.
Definition: engngm.h:368
DofManager * giveGlobalDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:326
#define _IFT_ErrorCheckingExportModule_writeIST
Which internal state types to write rules for.
virtual double giveLoadLevel()
Returns the current load level.
Definition: engngm.h:519
const double tolerance
Definition: expczmaterial.C:45
ElementErrorCheckingRule(const std::string &line, double tol)
bool checkValue(double computedValue)
Element * giveGlobalElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:171
Class representing vector of real numbers.
Definition: floatarray.h:82
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Definition: element.h:1069
Element is local, there are no contributions from other domains to this element.
Definition: element.h:101
This class implements a 2-dimensional beam element with cubic lateral displacement interpolation (rot...
Definition: beam3d.h:74
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
ErrorCheckingRule * giveErrorCheck(std::ifstream &stream, double errorTolerance)
GaussPoint * getIntegrationPoint(int n)
Access particular integration point of receiver.
virtual void doOutput(TimeStep *tStep, bool forcedOutput=false)
Writes the output.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: exportmodule.C:58
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void printYourself() const
Print receiver on stdout.
Definition: floatarray.C:747
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
Definition: dofmanager.C:119
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
Error checking rule used for regressions tests.
void writeCheck(Domain *domain, TimeStep *tStep)
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
virtual double giveEigenValue(int eigNum)
Only relevant for eigen value analysis. Otherwise returns zero.
Definition: engngm.h:522
EigenValueErrorCheckingRule(const std::string &line, double tol)
int giveVersion()
Returns receiver&#39;s version.
Definition: timestep.h:133
This class implements extension of EngngModel for structural models.
std::vector< std::unique_ptr< Element > > & giveElements()
Definition: domain.h:279
void computeReaction(FloatArray &answer, TimeStep *tStep, int di)
Computes reaction forces.
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
DofManager in active domain is only mirror of some remote DofManager.
Definition: dofmanager.h:85
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Node * giveNode(int n)
Service for accessing particular domain node.
Definition: domain.h:371
the oofem namespace is to define a context or scope in which all oofem names are defined.
BeamElementErrorCheckingRule(const std::string &line, double tol)
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Definition: engngm.C:1720
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
bool isNotTheLastStep()
Check if solution step is not the last step.
Definition: timestep.C:127
std::vector< std::unique_ptr< ErrorCheckingRule > > errorCheckingRules
virtual bool check(Domain *domain, TimeStep *tStep)
Checks if the rule is correct.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
Class representing solution step.
Definition: timestep.h:80
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
Definition: dofmanager.h:512
REGISTER_ExportModule(ErrorCheckingExportModule)
ReactionErrorCheckingRule(const std::string &line, double tol)

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