OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
initialcondition.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 "initialcondition.h"
36 #include "inputrecord.h"
37 #include "cltypes.h"
38 
39 namespace oofem {
41 // Returns the prescribed value of the kinematic unknown 'u'.
42 {
43  char u;
45  if ( this->hasConditionOn(u) ) {
46  return initialValueDictionary.at(u);
47  } else {
48  return 0.;
49  }
50 }
51 
52 
54 // Returns True if the receiver submits the unknown 'u' to an initial
55 // condition, else returns False.
56 {
57  return ( initialValueDictionary.includes(u) );
58 }
59 
60 
62 // Returns True if the receiver submits the unknown 'u' to an initial
63 // condition, else returns False.
64 {
65  char u = cltypesGiveUnknownTypeModeKey(type);
66  return ( initialValueDictionary.includes(u) );
67 }
68 
70 // Prints the receiver on screen.
71 {
72  printf("Initial condition %d\ninitial values :\n", number);
74 }
75 
76 
79 // Sets up the dictionary where the receiver stores the conditions it
80 // imposes.
81 {
82  IRResultType result; // Required by IR_GIVE_FIELD macro
83 
85 
86  int val = 0;
88  valType = ( bcValType ) val;
89 
91  this->set = 0;
93  this->dofIDs.clear();
95 
96  return IRRT_OK;
97 }
98 
99 
100 void
102 {
103  if ( this->hasConditionOn(type) ) {
104  initialValueDictionary.at(type) *= s;
105  }
106 }
107 } // end namespace oofem
void printYourself()
Prints the receiver on screen.
Definition: dictionary.C:145
#define _IFT_InitialCondition_conditions
int number
Component number.
Definition: femcmpnn.h:80
virtual void printYourself()
Prints receiver state on stdout. Useful for debugging.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
bcValType
Type determining the type of general boundary condition.
Definition: bcvaltype.h:40
double & at(int aKey)
Returns the value of the pair which key is aKey.
Definition: dictionary.C:106
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
bool includes(int aKey)
Checks if dictionary includes given key.
Definition: dictionary.C:126
void clear()
Clears the array (zero size).
Definition: intarray.h:177
int hasConditionOn(int u)
Tests if receiver has initial condition for specific unknown-mode.
double give(ValueModeType mode)
Returns value of initial condition for given unknown mode (determines whether total or velocity or ac...
IntArray dofIDs
List of dof ids that IC is applied to.
bcValType valType
Physical meaning of bc value.
Dictionary initialValueDictionary
Dictionary of initial values.
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_InitialCondition_valType
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
#define _IFT_InitialCondition_set
char cltypesGiveUnknownTypeModeKey(ValueModeType mode)
Definition: cltypes.C:57
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
#define _IFT_InitialCondition_dofs
virtual void scale(ValueModeType type, double s)
Scales the receiver value (determined by ValueModeType) by given value.

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:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011