OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
femcmpnn.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 /*
36  * The original idea for this class comes from
37  * Dubois-Pelerin, Y.: "Object-Oriented Finite Elements: Programming concepts and Implementation",
38  * PhD Thesis, EPFL, Lausanne, 1992.
39  */
40 
41 #include "femcmpnn.h"
42 #include "datastream.h"
43 #include "contextioerr.h"
44 #include "dynamicinputrecord.h"
45 
46 #include <cstdarg>
47 
48 
49 namespace oofem {
52 {
53  if ( mode & CM_Definition ) {
54  if ( !stream.write(number) ) {
56  }
57  }
58 
59  return CIO_OK;
60 }
61 
62 
65 {
66  if ( mode & CM_Definition ) {
67  if ( !stream.read(number) ) {
69  }
70  }
71 
72  return CIO_OK;
73 }
74 
75 
76 void
78 {
79  input.setRecordKeywordField( this->giveInputRecordName(), this->giveNumber() );
80 }
81 
82 
83 std :: string
84 FEMComponent :: errorInfo(const char *func) const
85 {
86  return std :: string(this->giveClassName()) + "::" + func + ", number: " + std::to_string(this->giveNumber());
87 }
88 
90 {
91  return IRRT_OK;
92 }
93 
95 {
96  return 1;
97 }
98 
99 } // end namespace oofem
int number
Component number.
Definition: femcmpnn.h:80
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
virtual const char * giveInputRecordName() const =0
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: femcmpnn.C:51
General IO error.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: femcmpnn.C:77
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
Definition: femcmpnn.C:94
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: femcmpnn.C:89
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual const char * giveClassName() const =0
Class representing the general Input Record.
Definition: inputrecord.h:101
std::string errorInfo(const char *func) const
Returns string for prepending output (used by error reporting macros).
Definition: femcmpnn.C:84
Class representing the a dynamic Input Record.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
#define CM_Definition
Definition: contextmode.h:47
void setRecordKeywordField(std::string keyword, int number)
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: femcmpnn.C:64
the oofem namespace is to define a context or scope in which all oofem names are defined.
int giveNumber() const
Definition: femcmpnn.h:107

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