ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef ERRORS_H
32#define ERRORS_H
33
34//Definition of Error classes of all kind
35//Exceptions on input XML files
36
37#include <iostream>
38#include <sstream>
39#include <cassert>
40#include <vector>
41#include <cmath>
42#include <list>
43#include <string>
44#include <algorithm>
45
48{
51};
52
53// Macro allowing to use assert with error message
54#ifndef NDEBUG
55 #define assertM(condition, message) \
56 do { \
57 if (!(condition)) { \
58 std::cerr << "---------------------------------------------------------" << std::endl \
59 << "Error assertion not verified" << std::endl \
60 << " file: " << __FILE__ << std::endl \
61 << " line: " << __LINE__ << std::endl \
62 << " assertion: `" #condition "` failed" << std::endl \
63 << " " << message << std::endl \
64 << "---------------------------------------------------------" << std::endl; \
65 std::exit(EXIT_FAILURE); \
66 } \
67 } while (false)
68#else
69 #define ASSERT(condition, message) \
70 do { \
71 } while (false)
72#endif
73
74//***************************************************************************************
75//--------------------------Computing errors/warnings definition-------------------------
76//***************************************************************************************
77
78class Errors
79{
80 public:
81 Errors();
82 Errors(const std::string& message_, const char* sourceFile = "unknown", int lineNumber_ = -1);
83 virtual ~Errors();
84
85 static void errorMessage(const std::string& message_);
86 static void errorMessage(const std::string& message_, double value);
87 static void errorMessage(const std::string& message_, const char* sourceFile, int lineNumber_);
88
89 void setError(const std::string& message_, const char* sourceFile = "", int lineNumber_ = -1);
90 void setError(const std::string& message_, const double value);
91 std::string errorToString(const int& num, const int& ErrorType, const int iteration = -1) const;
92 void displayError(const int& num) const;
93
94 //Accessor
95 int getState();
96
97 static constexpr int defaultInt = 0;
98 static constexpr int defaultIntNeg = -1;
99 static constexpr double defaultDouble = 0.;
100 static const std::string defaultString;
101
102 private:
103 std::string m_message;
105 std::string m_file;
107 double m_value;
108};
109
110extern std::vector<Errors> errors;
111extern std::vector<Errors> warnings; //FP//TODO// To improve by a specific class
112
113//***************************************************************************************
114//--------------------------------------EXCEPTIONS---------------------------------------
115//***************************************************************************************
116
117//Exception handling on error code ECOGEN
118//---------------------------------------
119class ErrorECOGEN : public std::exception
120{
121 public:
122 //***************
123 ErrorECOGEN(std::string infoError_ = "", const char* sourceFile = "", int lineNumber_ = -1, int errorCode = 1) :
124 std::exception(), m_errorCode(errorCode), m_lineNumber(lineNumber_), m_sourceFile(sourceFile), m_infoError(infoError_)
125 {}
126 virtual ~ErrorECOGEN() throw() {}
127 //***************
128 virtual const char* what(void) const throw() { return "Exception ECOGEN: fix and restart run"; }
129 //***************
130 std::string infoError(void) const throw()
131 {
132 std::stringstream message_;
133 message_ << "--------------------------------------------------" << std::endl;
134 message_ << this->what() << std::endl;
135 message_ << "****************************************" << std::endl;
136 if (m_sourceFile != "") {
137 message_ << " infos on exception in code source :" << std::endl;
138 message_ << " file: '" << m_sourceFile << "'" << std::endl;
139 if (m_lineNumber != -1) message_ << " line: " << m_lineNumber << std::endl;
140 }
141 message_ << this->additionalInfo() << std::endl;
142 message_ << "--------------------------------------------------" << std::endl;
143 return message_.str();
144 }
145 //***************
146 virtual std::string additionalInfo(void) const throw() { return m_infoError; }
147 //***************
148 int getErrorCode() { return m_errorCode; }
149 //***************
150 private:
153 std::string m_sourceFile;
154 std::string m_infoError;
155};
156
157//---------------------------------------------------------------
158
159//Exception handling on input files (XML, mesh)
160//---------------------------------------------
161
163{
164 public:
165 //***************
166 ErrorInput(std::string fileInput = "", const char* sourceFile = "", int lineNumber_ = -1, int errorCode = 2) :
167 ErrorECOGEN(), m_errorCode(errorCode), m_lineNumber(lineNumber_), m_sourceFile(sourceFile), m_fileInput(fileInput)
168 {}
169 virtual ~ErrorInput() throw() {}
170 //***************
171 virtual const char* what(void) const throw() { return "Exception during reading input file"; }
172 //***************
173 std::string infoError(void) const throw()
174 {
175 std::stringstream message_;
176 message_ << "--------------------------------------------------" << std::endl;
177 message_ << this->what() << std::endl;
178 message_ << "****************************************" << std::endl;
179 if (m_fileInput != "") {
180 message_ << " Input file concerned: '" << m_fileInput << "'" << std::endl;
181 }
182 if (m_sourceFile != "") {
183 message_ << " Infos on exception in source code:" << std::endl;
184 message_ << " file: '" << m_sourceFile << "'" << std::endl;
185 if (m_lineNumber != -1) message_ << " line: " << m_lineNumber << std::endl;
186 }
187 message_ << this->additionalInfo();
188 message_ << "--------------------------------------------------" << std::endl;
189 return message_.str();
190 }
191 //***************
192 virtual std::string additionalInfo(void) const throw() { return ""; }
193 //***************
194 int lineNumber() const throw() { return m_lineNumber; }
195 //***************
196 std::string fileName() const throw() { return m_sourceFile; }
197 //***************
198 int getErrorCode() { return m_errorCode; }
199 //***************
200 protected:
203 std::string m_sourceFile;
204 std::string m_fileInput;
205};
206
207//---------------------------------------------------------------
208
209//Exception handling on unstructured mesh file
210//--------------------------------------------
212{
213 public:
214 //***************
215 ErrorMeshNS(std::string fileMesh = "", const char* sourceFile = "", int lineNumber_ = -1, int errorCode = 2) :
216 ErrorInput(fileMesh, sourceFile, lineNumber_, errorCode)
217 {}
218 virtual ~ErrorMeshNS() throw() {}
219 //***************
220 virtual const char* what(void) const throw() { return "Exception during reading unstructured mesh file: file not found or incorrect structure"; }
221 //***************
222 std::string infoError(void) const throw()
223 {
224 std::stringstream message_;
225 message_ << "--------------------------------------------------" << std::endl;
226 message_ << this->what() << std::endl;
227 message_ << "****************************************" << std::endl;
228 if (m_fileInput != "") {
229 message_ << " mesh file concerned: '" << m_fileInput << "'" << std::endl;
230 }
231 if (m_sourceFile != "") {
232 message_ << " infos on exception in code source :" << std::endl;
233 message_ << " file: '" << m_sourceFile << "'" << std::endl;
234 if (m_lineNumber != -1) message_ << " line: " << m_lineNumber << std::endl;
235 }
236 message_ << this->additionalInfo();
237 message_ << "--------------------------------------------------" << std::endl;
238 return message_.str();
239 }
240};
241
242//---------------------------------------------------------------
243
244//Exception handling on input XML files
245//-------------------------------------
246
247class ErrorXML : public ErrorInput
248{
249 public:
250 //***************
251 ErrorXML(std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1, int errorCode = 2) :
252 ErrorInput(fileXML, sourceFile, lineNumber_, errorCode)
253 {}
254 virtual ~ErrorXML() throw() {}
255 //***************
256 virtual const char* what(void) const throw() { return "Exception during reading XML file: file not found or incorrect structure"; }
257 //***************
258 std::string infoError(void) const throw()
259 {
260 std::stringstream message_;
261 message_ << "--------------------------------------------------" << std::endl;
262 message_ << this->what() << std::endl;
263 message_ << "****************************************" << std::endl;
264 if (m_fileInput != "") {
265 message_ << " XML file concerned: '" << m_fileInput << "'" << std::endl;
266 }
267 if (m_sourceFile != "") {
268 message_ << " infos on exception in code source :" << std::endl;
269 message_ << " file: '" << m_sourceFile << "'" << std::endl;
270 if (m_lineNumber != -1) message_ << " line: " << m_lineNumber << std::endl;
271 }
272 message_ << this->additionalInfo();
273 message_ << "--------------------------------------------------" << std::endl;
274 return message_.str();
275 }
276};
277
278//---------------------------------------------------------------
279
281{
282 public:
283 //***************
284 ErrorXMLMessage(std::string message_ = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
285 ErrorXML(fileXML, sourceFile, lineNumber_), m_message(message_)
286 {}
287 virtual ~ErrorXMLMessage() throw() {}
288 //***************
289 virtual const char* what(void) const throw() { return "Exception on XML file: input files are not compatible"; }
290 //***************
291 virtual std::string additionalInfo(void) const throw()
292 {
293 std::stringstream message_;
294 message_ << " details: " << m_message << std::endl;
295 return message_.str();
296 }
297 //***************
298 std::string message() const throw() { return m_message; }
299 //***************
300 private:
301 std::string m_message;
302};
303
304//---------------------------------------------------------------
305
307{
308 public:
309 //***************
310 ErrorXMLRacine(std::string root_ = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
311 ErrorXML(fileXML, sourceFile, lineNumber_), m_root(root_)
312 {}
313 virtual ~ErrorXMLRacine() throw() {}
314 //***************
315 virtual const char* what(void) const throw() { return "Exception on XML file: root not found"; }
316 //***************
317 virtual std::string additionalInfo(void) const throw()
318 {
319 std::stringstream message_;
320 message_ << " root name searched: '" << m_root << "'" << std::endl;
321 return message_.str();
322 }
323 //***************
324 std::string root() const throw() { return m_root; }
325 //***************
326 private:
327 std::string m_root;
328};
329
330//---------------------------------------------------------------
331
333{
334 public:
335 //***************
336 ErrorXMLElement(std::string element_ = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
337 ErrorXML(fileXML, sourceFile, lineNumber_), m_element(element_)
338 {}
339 virtual ~ErrorXMLElement() throw() {}
340 //***************
341 virtual const char* what(void) const throw() { return "Exception on XML file: element not found"; }
342 //***************
343 virtual std::string additionalInfo(void) const throw()
344 {
345 std::stringstream message_;
346 message_ << " element name searched: '" << m_element << "'" << std::endl;
347 return message_.str();
348 }
349 //***************
350 std::string element() const throw() { return m_element; }
351 //***************
352 private:
353 std::string m_element;
354};
355
356//---------------------------------------------------------------
357
359{
360 public:
361 //***************
362 ErrorXMLAttribut(std::string attribute_ = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
363 ErrorXML(fileXML, sourceFile, lineNumber_), m_attribute(attribute_)
364 {}
365 virtual ~ErrorXMLAttribut() throw() {}
366 //***************
367 virtual const char* what(void) const throw() { return "Exception on XML file: attribute not found"; }
368 //***************
369 virtual std::string additionalInfo(void) const throw()
370 {
371 std::stringstream message_;
372 message_ << " attribute name searched: '" << m_attribute << "'" << std::endl;
373 return message_.str();
374 }
375 //***************
376 std::string attribute() const throw() { return m_attribute; }
377 //***************
378 private:
379 std::string m_attribute;
380};
381
382//---------------------------------------------------------------
383
384class ErrorXMLDev : public ErrorXML
385{
386 public:
387 //***************
388 ErrorXMLDev(std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) : ErrorXML(fileXML, sourceFile, lineNumber_) {}
389 virtual ~ErrorXMLDev() throw() {}
390 //***************
391 virtual const char* what(void) const throw() { return "Exception on XML file: this portion of code is under development"; }
392 //***************
393 private:
394};
395
396//---------------------------------------------------------------
397
399{
400 public:
401 //***************
402 ErrorXMLLimite(std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) : ErrorXML(fileXML, sourceFile, lineNumber_) {}
403 virtual ~ErrorXMLLimite() throw() {}
404 //***************
405 virtual const char* what(void) const throw() { return "Exception on XML file: error in boundary conditions"; }
406 //***************
407 private:
408};
409
410//---------------------------------------------------------------
411
413{
414 public:
415 //***************
416 ErrorXMLTermeSource(std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) : ErrorXML(fileXML, sourceFile, lineNumber_) {}
417 virtual ~ErrorXMLTermeSource() throw() {}
418 //***************
419 virtual const char* what(void) const throw() { return "Exception on XML file: error in source term selection"; }
420 //***************
421 private:
422};
423
424//---------------------------------------------------------------
425
426class ErrorXMLEOS : public ErrorXML
427{
428 public:
429 //***************
430 ErrorXMLEOS(std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) : ErrorXML(fileXML, sourceFile, lineNumber_) {}
431 virtual ~ErrorXMLEOS() throw() {}
432 //***************
433 virtual const char* what(void) const throw() { return "Exception on XML file: error on equation of state"; }
434 //***************
435 private:
436};
437
438//---------------------------------------------------------------
439
441{
442 public:
443 //***************
444 ErrorXMLEOSUnknown(std::string typeEOS = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
445 ErrorXML(fileXML, sourceFile, lineNumber_), m_typeEOS(typeEOS)
446 {}
447 virtual ~ErrorXMLEOSUnknown() throw() {}
448 //***************
449 virtual const char* what(void) const throw() { return "Exception on XML file: error on equation of state"; }
450 //***************
451 virtual std::string additionalInfo(void) const throw()
452 {
453 std::stringstream message_;
454 message_ << " EOS type: '" << m_typeEOS << "' unknown" << std::endl;
455 return message_.str();
456 }
457 //***************
458 private:
459 std::string m_typeEOS;
460};
461
462//---------------------------------------------------------------
463
465{
466 public:
467 //***************
468 ErrorXMLDomaineUnknown(std::string typeDomain = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
469 ErrorXML(fileXML, sourceFile, lineNumber_), m_typeDomain(typeDomain)
470 {}
471 virtual ~ErrorXMLDomaineUnknown() throw() {}
472 //***************
473 virtual const char* what(void) const throw() { return "Exception on XML file: error on domain CI"; }
474 //***************
475 virtual std::string additionalInfo(void) const throw()
476 {
477 std::stringstream message_;
478 message_ << " domain type: '" << m_typeDomain << "' unknown" << std::endl;
479 return message_.str();
480 }
481 //***************
482 private:
483 std::string m_typeDomain;
484};
485
486//---------------------------------------------------------------
487
489{
490 public:
491 //***************
492 ErrorXMLBoundCondUnknown(std::string typeBoundCond = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
493 ErrorXML(fileXML, sourceFile, lineNumber_), m_typeBoundCond(typeBoundCond)
494 {}
495 virtual ~ErrorXMLBoundCondUnknown() throw() {}
496 //***************
497 virtual const char* what(void) const throw() { return "Exception on XML file: error in boundary condition"; }
498 //***************
499 virtual std::string additionalInfo(void) const throw()
500 {
501 std::stringstream message_;
502 message_ << " boundary type: '" << m_typeBoundCond << "' unknown" << std::endl;
503 return message_.str();
504 }
505 //***************
506 private:
507 std::string m_typeBoundCond;
508};
509
510//---------------------------------------------------------------
511
512class ErrorXMLEtat : public ErrorXML
513{
514 public:
515 //***************
516 ErrorXMLEtat(std::string nameEtat = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
517 ErrorXML(fileXML, sourceFile, lineNumber_), m_nameEtat(nameEtat)
518 {}
519 virtual ~ErrorXMLEtat() throw() {}
520 //***************
521 virtual const char* what(void) const throw() { return "Exception on XML file: error in state"; }
522 //***************
523 virtual std::string additionalInfo(void) const throw()
524 {
525 std::stringstream message_;
526 message_ << " state: '" << m_nameEtat << "' not found or incomplete" << std::endl;
527 return message_.str();
528 }
529 //***************
530 private:
531 std::string m_nameEtat;
532};
533
534//---------------------------------------------------------------
535
537{
538 public:
539 //***************
540 ErrorXMLMaterialUnknown(std::string nameMateriau = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
541 ErrorXML(fileXML, sourceFile, lineNumber_), m_nameMateriau(nameMateriau)
542 {}
543 virtual ~ErrorXMLMaterialUnknown() throw() {}
544 //***************
545 virtual const char* what(void) const throw() { return "Exception on XML file: error in state CI"; }
546 //***************
547 virtual std::string additionalInfo(void) const throw()
548 {
549 std::stringstream message_;
550 message_ << " material type: '" << m_nameMateriau << "' unknown" << std::endl;
551 return message_.str();
552 }
553 //***************
554 private:
555 std::string m_nameMateriau;
556};
557
558//---------------------------------------------------------------
559
561{
562 public:
563 //***************
564 ErrorXMLStretching(std::string message_, std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
565 ErrorXMLMessage(message_, fileXML, sourceFile, lineNumber_)
566 {}
567 virtual ~ErrorXMLStretching() throw() {}
568 //***************
569 virtual const char* what(void) const throw() { return "Exception on XML file: error on stretching definition"; }
570};
571
572//---------------------------------------------------------------
573
575{
576 public:
577 //***************
578 ErrorXMLRelaxation(std::string nameRelaxation = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber_ = -1) :
579 ErrorXML(fileXML, sourceFile, lineNumber_), m_nameRelaxation(nameRelaxation)
580 {}
581 virtual ~ErrorXMLRelaxation() throw() {}
582 //***************
583 virtual const char* what(void) const throw() { return "Exception on XML file: error on relaxation"; }
584 //***************
585 virtual std::string additionalInfo(void) const throw()
586 {
587 std::stringstream message_;
588 message_ << " relaxation type: '" << m_nameRelaxation << "' unknown or already added" << std::endl;
589 return message_.str();
590 }
591 //***************
592 private:
593 std::string m_nameRelaxation;
594};
595
596//---------------------------------------------------------------
597
598#endif // ERRORS_H
std::vector< Errors > errors
Definition Errors.cpp:35
std::vector< Errors > warnings
Definition Errors.cpp:36
TypeError
Enumeration for the type of error (warning, error).
Definition Errors.h:48
@ ERROR
Definition Errors.h:50
@ WARNING
Definition Errors.h:49
std::string infoError(void) const
Definition Errors.h:130
std::string m_infoError
Definition Errors.h:154
virtual std::string additionalInfo(void) const
Definition Errors.h:146
int m_errorCode
Definition Errors.h:151
int getErrorCode()
Definition Errors.h:148
ErrorECOGEN(std::string infoError_="", const char *sourceFile="", int lineNumber_=-1, int errorCode=1)
Definition Errors.h:123
virtual ~ErrorECOGEN()
Definition Errors.h:126
int m_lineNumber
Definition Errors.h:152
virtual const char * what(void) const
Definition Errors.h:128
std::string m_sourceFile
Definition Errors.h:153
virtual const char * what(void) const
Definition Errors.h:171
int getErrorCode()
Definition Errors.h:198
int m_errorCode
Definition Errors.h:201
ErrorInput(std::string fileInput="", const char *sourceFile="", int lineNumber_=-1, int errorCode=2)
Definition Errors.h:166
std::string m_sourceFile
Definition Errors.h:203
std::string fileName() const
Definition Errors.h:196
int m_lineNumber
Definition Errors.h:202
virtual std::string additionalInfo(void) const
Definition Errors.h:192
std::string infoError(void) const
Definition Errors.h:173
virtual ~ErrorInput()
Definition Errors.h:169
std::string m_fileInput
Definition Errors.h:204
int lineNumber() const
Definition Errors.h:194
virtual ~ErrorMeshNS()
Definition Errors.h:218
virtual const char * what(void) const
Definition Errors.h:220
std::string infoError(void) const
Definition Errors.h:222
ErrorMeshNS(std::string fileMesh="", const char *sourceFile="", int lineNumber_=-1, int errorCode=2)
Definition Errors.h:215
ErrorXMLAttribut(std::string attribute_="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:362
virtual ~ErrorXMLAttribut()
Definition Errors.h:365
std::string attribute() const
Definition Errors.h:376
virtual std::string additionalInfo(void) const
Definition Errors.h:369
std::string m_attribute
Definition Errors.h:379
virtual const char * what(void) const
Definition Errors.h:367
virtual ~ErrorXMLBoundCondUnknown()
Definition Errors.h:495
virtual std::string additionalInfo(void) const
Definition Errors.h:499
std::string m_typeBoundCond
Definition Errors.h:507
ErrorXMLBoundCondUnknown(std::string typeBoundCond="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:492
virtual const char * what(void) const
Definition Errors.h:497
ErrorXMLDev(std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:388
virtual const char * what(void) const
Definition Errors.h:391
virtual ~ErrorXMLDev()
Definition Errors.h:389
std::string m_typeDomain
Definition Errors.h:483
virtual const char * what(void) const
Definition Errors.h:473
ErrorXMLDomaineUnknown(std::string typeDomain="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:468
virtual ~ErrorXMLDomaineUnknown()
Definition Errors.h:471
virtual std::string additionalInfo(void) const
Definition Errors.h:475
virtual ~ErrorXMLEOSUnknown()
Definition Errors.h:447
std::string m_typeEOS
Definition Errors.h:459
virtual std::string additionalInfo(void) const
Definition Errors.h:451
ErrorXMLEOSUnknown(std::string typeEOS="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:444
virtual const char * what(void) const
Definition Errors.h:449
virtual ~ErrorXMLEOS()
Definition Errors.h:431
virtual const char * what(void) const
Definition Errors.h:433
ErrorXMLEOS(std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:430
std::string m_element
Definition Errors.h:353
virtual const char * what(void) const
Definition Errors.h:341
virtual std::string additionalInfo(void) const
Definition Errors.h:343
std::string element() const
Definition Errors.h:350
ErrorXMLElement(std::string element_="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:336
virtual ~ErrorXMLElement()
Definition Errors.h:339
virtual ~ErrorXMLEtat()
Definition Errors.h:519
virtual std::string additionalInfo(void) const
Definition Errors.h:523
std::string m_nameEtat
Definition Errors.h:531
ErrorXMLEtat(std::string nameEtat="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:516
virtual const char * what(void) const
Definition Errors.h:521
virtual const char * what(void) const
Definition Errors.h:405
virtual ~ErrorXMLLimite()
Definition Errors.h:403
ErrorXMLLimite(std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:402
std::string m_nameMateriau
Definition Errors.h:555
ErrorXMLMaterialUnknown(std::string nameMateriau="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:540
virtual const char * what(void) const
Definition Errors.h:545
virtual ~ErrorXMLMaterialUnknown()
Definition Errors.h:543
virtual std::string additionalInfo(void) const
Definition Errors.h:547
std::string m_message
Definition Errors.h:301
virtual const char * what(void) const
Definition Errors.h:289
virtual std::string additionalInfo(void) const
Definition Errors.h:291
std::string message() const
Definition Errors.h:298
ErrorXMLMessage(std::string message_="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:284
virtual ~ErrorXMLMessage()
Definition Errors.h:287
std::string root() const
Definition Errors.h:324
ErrorXMLRacine(std::string root_="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:310
std::string m_root
Definition Errors.h:327
virtual const char * what(void) const
Definition Errors.h:315
virtual ~ErrorXMLRacine()
Definition Errors.h:313
virtual std::string additionalInfo(void) const
Definition Errors.h:317
virtual const char * what(void) const
Definition Errors.h:583
ErrorXMLRelaxation(std::string nameRelaxation="", std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:578
std::string m_nameRelaxation
Definition Errors.h:593
virtual ~ErrorXMLRelaxation()
Definition Errors.h:581
virtual std::string additionalInfo(void) const
Definition Errors.h:585
virtual const char * what(void) const
Definition Errors.h:569
virtual ~ErrorXMLStretching()
Definition Errors.h:567
ErrorXMLStretching(std::string message_, std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:564
ErrorXMLTermeSource(std::string fileXML="", const char *sourceFile="", int lineNumber_=-1)
Definition Errors.h:416
virtual const char * what(void) const
Definition Errors.h:419
virtual ~ErrorXMLTermeSource()
Definition Errors.h:417
virtual const char * what(void) const
Definition Errors.h:256
ErrorXML(std::string fileXML="", const char *sourceFile="", int lineNumber_=-1, int errorCode=2)
Definition Errors.h:251
virtual ~ErrorXML()
Definition Errors.h:254
std::string infoError(void) const
Definition Errors.h:258
static const std::string defaultString
Definition Errors.h:100
double m_value
Allows you to send an additionnal piece of information.
Definition Errors.h:107
static constexpr int defaultInt
Definition Errors.h:97
std::string m_message
Definition Errors.h:103
void displayError(const int &num) const
Definition Errors.cpp:149
std::string errorToString(const int &num, const int &ErrorType, const int iteration=-1) const
Definition Errors.cpp:119
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
int m_line
Definition Errors.h:106
std::string m_file
Definition Errors.h:105
static constexpr int defaultIntNeg
Definition Errors.h:98
Errors()
Definition Errors.cpp:40
int m_state
Definition Errors.h:104
void setError(const std::string &message_, const char *sourceFile="", int lineNumber_=-1)
Definition Errors.cpp:97
virtual ~Errors()
Definition Errors.cpp:52
int getState()
Definition Errors.cpp:116
static constexpr double defaultDouble
Definition Errors.h:99