OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
activebc.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 activebc_h
36 #define activebc_h
37 
39 #include "intarray.h"
40 #include "inputrecord.h"
41 #include "chartype.h"
42 #include "valuemodetype.h"
43 #include "error.h"
44 
45 #include <vector>
46 
48 
49 #define _IFT_ActiveBoundaryCondition_elementSides "elementsides"
50 
51 
52 namespace oofem {
53 class SparseMtrx;
54 class UnknownNumberingScheme;
55 class ActiveDof;
56 class Dof;
57 class PrimaryField;
58 
64 {
65 public:
74 
76  {
78 
79  IRResultType result;
80  IntArray tempA, tempB, tempC;
82  for ( int i = 0; i < tempB.giveSize() / 2; ++i ) {
83  this->addElementSide( tempB(i * 2), tempB(i * 2 + 1) );
84  }
85 
86  return IRRT_OK;
87  }
88 
90 
91 
96  virtual void addElementSide(int elem, int side) { OOFEM_ERROR("Not supported"); }
98 
109  virtual void assemble(SparseMtrx &answer, TimeStep *tStep,
110  CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale = 1.0) { }
111 
122  virtual void assembleVector(FloatArray &answer, TimeStep *tStep,
123  CharType type, ValueModeType mode,
124  const UnknownNumberingScheme &s, FloatArray *eNorms = NULL) { }
125 
138  virtual void giveLocationArrays(std :: vector< IntArray > &rows, std :: vector< IntArray > &cols, CharType type,
139  const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s) { }
140 
141 
152  virtual bool requiresActiveDofs() { return false; }
157  virtual bool isPrimaryDof(ActiveDof *dof) { return true; }
161  virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep) { return 0.0; }
166  virtual bool hasBc(Dof *dof, TimeStep *tStep) { return false; }
173  {
174  OOFEM_ERROR("Not supported by bc.");
175  return 0;
176  }
183  virtual Dof *giveMasterDof(ActiveDof *dof, int mdof)
184  {
185  OOFEM_ERROR("Not supported by bc.");
186  return NULL;
187  }
188  virtual void computeDofTransformation(ActiveDof *dof, FloatArray &masterContribs)
189  {
190  OOFEM_ERROR("Not supported by bc.");
191  }
200  virtual double giveUnknown(PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
201  {
202  OOFEM_ERROR("Not supported by bc.");
203  return 0.0;
204  }
212  virtual double giveUnknown(ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
213  {
214  OOFEM_ERROR("Not supported by bc.");
215  return 0.0;
216  }
218 };
219 } // end namespace oofem
220 #endif // activebc_h
Class and object Domain.
Definition: domain.h:115
virtual bool requiresActiveDofs()
Checks to see if active boundary condition requires special DOFs.
Definition: activebc.h:152
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: activebc.h:75
Abstract class representing field of primary variables (those, which are unknown and are typically as...
Definition: primaryfield.h:104
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
Definition: activebc.h:161
virtual int giveNumberOfMasterDofs(ActiveDof *dof)
Allows for active boundary conditions to handle their own special DOF.
Definition: activebc.h:172
virtual Dof * giveMasterDof(ActiveDof *dof, int mdof)
Give the pointer to master dof belonging to active DOF.
Definition: activebc.h:183
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0)
Assembles B.C.
Definition: activebc.h:109
virtual double giveUnknown(PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
Computes the value of the dof.
Definition: activebc.h:200
Class implementing an array of integers.
Definition: intarray.h:61
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void addElementSide(int elem, int side)
Adds element for active boundary condition.
Definition: activebc.h:96
virtual bool hasBc(Dof *dof, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
Definition: activebc.h:166
virtual void computeDofTransformation(ActiveDof *dof, FloatArray &masterContribs)
Definition: activebc.h:188
#define OOFEM_ERROR(...)
Definition: error.h:61
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
Abstract base class for all active boundary conditions.
Definition: activebc.h:63
Abstract base class for all boundary conditions of problem.
Class representing "slave" degree of freedom with an active boundary condition.
Definition: activedof.h:48
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
CharType
Definition: chartype.h:87
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual bool isPrimaryDof(ActiveDof *dof)
Checks to see if the dof is a primary DOF.
Definition: activebc.h:157
ActiveBoundaryCondition(int n, Domain *d)
Constructor.
Definition: activebc.h:71
#define _IFT_ActiveBoundaryCondition_elementSides
Definition: activebc.h:49
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Definition: intarray.h:203
the oofem namespace is to define a context or scope in which all oofem names are defined.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
virtual ~ActiveBoundaryCondition()
Destructor.
Definition: activebc.h:73
virtual void assembleVector(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms=NULL)
Assembles B.C.
Definition: activebc.h:122
Class representing solution step.
Definition: timestep.h:80
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
Computes the value of the dof.
Definition: activebc.h:212
virtual void giveLocationArrays(std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
Gives a list of location arrays that will be assembled.
Definition: activebc.h:138

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