OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
enrichmentfunction.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 enrichmentfunction_h
36 #define enrichmentfunction_h
37 
38 #include "intarray.h"
39 #include "femcmpnn.h"
40 
41 #define _IFT_DiscontinuousFunction_Name "discontinuousfunction"
42 #define _IFT_HeavisideFunction_Name "heavisidefunction"
43 #define _IFT_RampFunction_Name "rampfunction"
44 
45 namespace oofem {
46 class EnrichmentItem;
47 class EnrichmentDomain;
48 class BasicGeometry;
49 class GaussPoint;
50 
60 class OOFEM_EXPORT EnrichmentFunction : public FEMComponent
61 {
62 public:
68  EnrichmentFunction(int n, Domain *aDomain) : FEMComponent(n, aDomain) { }
70  virtual ~EnrichmentFunction() { }
71 
72  // New interface
73  virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const = 0;
74  virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const = 0;
75 
81  virtual void giveJump(std :: vector< double > &oJumps) const = 0;
82 
83  virtual IRResultType initializeFrom(InputRecord *ir);
84  virtual void giveInputRecord(DynamicInputRecord &input);
85  virtual const char *giveClassName() const { return "EnrichmentFunction"; }
86  int giveNumberOfDofs() const { return numberOfDofs; }
87 
88 protected:
89 
91 };
92 
94 class OOFEM_EXPORT DiscontinuousFunction : public EnrichmentFunction
95 {
96 public:
97  DiscontinuousFunction(int n, Domain *aDomain) : EnrichmentFunction(n, aDomain) {
98  this->numberOfDofs = 1;
99  }
100 
101  virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const;
102  virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const;
103 
104  virtual void giveJump(std :: vector< double > &oJumps) const {
105  oJumps.clear();
106  oJumps.push_back(2.0);
107  }
108 
109  virtual const char *giveClassName() const { return "DiscontinuousFunction"; }
110  virtual const char *giveInputRecordName() const { return _IFT_DiscontinuousFunction_Name; }
111 };
112 
118 class OOFEM_EXPORT HeavisideFunction : public EnrichmentFunction
119 {
120 public:
121  HeavisideFunction(int n, Domain *aDomain) : EnrichmentFunction(n, aDomain) {
122  this->numberOfDofs = 1;
123  }
124 
125  virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const;
126  virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const;
127 
128  virtual void giveJump(std :: vector< double > &oJumps) const {
129  oJumps.clear();
130  oJumps.push_back(1.0);
131  }
132 
133  virtual const char *giveClassName() const { return "HeavisideFunction"; }
134  virtual const char *giveInputRecordName() const { return _IFT_HeavisideFunction_Name; }
135 };
136 
138 class OOFEM_EXPORT LinElBranchFunction
139 {
140 public:
142  virtual ~LinElBranchFunction() { }
143 
144  virtual void evaluateEnrFuncAt(std :: vector< double > &oEnrFunc, const double &iR, const double &iTheta) const;
145  virtual void evaluateEnrFuncDerivAt(std :: vector< FloatArray > &oEnrFuncDeriv, const double &iR, const double &iTheta) const;
146 
147  virtual void giveJump(std :: vector< double > &oJumps) const;
148  virtual void giveJump(std :: vector< double > &oJumps, const double &iRadius) const;
149 
150  std :: string errorInfo(const char *func) const { return std :: string( giveClassName() ) + func; }
151  virtual const char *giveClassName() const { return "LinElBranchFunction"; }
152 };
153 
155 class OOFEM_EXPORT CohesiveBranchFunction
156 {
157 public:
158  CohesiveBranchFunction():mExponent(0.5) { }
160 
161  virtual void evaluateEnrFuncAt(std :: vector< double > &oEnrFunc, const double &iR, const double &iTheta) const;
162  virtual void evaluateEnrFuncDerivAt(std :: vector< FloatArray > &oEnrFuncDeriv, const double &iR, const double &iTheta) const;
163 
164  virtual void giveJump(std :: vector< double > &oJumps) const;
165  virtual void giveJump(std :: vector< double > &oJumps, const double &iRadius) const;
166 
167  std :: string errorInfo(const char *func) const { return std :: string( giveClassName() ) + func; }
168  virtual const char *giveClassName() const { return "CohesiveBranchFunction"; }
169 
170 protected:
171  double mExponent;
172 };
173 
175 class OOFEM_EXPORT RampFunction : public EnrichmentFunction
176 {
177 public:
178 
179  RampFunction(int n, Domain *aDomain) : EnrichmentFunction(n, aDomain) {
180  this->numberOfDofs = 1;
181  }
182 
183  virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const;
184  virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const;
185 
186  virtual void giveJump(std :: vector< double > &oJumps) const {
187  oJumps.clear();
188  oJumps.push_back(0.0);
189  }
190 
191  virtual const char *giveClassName() const { return "RampFunction"; }
192  virtual const char *giveInputRecordName() const { return _IFT_RampFunction_Name; }
193 };
194 } // end namespace oofem
195 #endif // enrichmentfunction_h
#define _IFT_HeavisideFunction_Name
virtual void giveJump(std::vector< double > &oJumps) const
Returns the discontinuous jump in the enrichment function when the lvel set function changes sign...
Class and object Domain.
Definition: domain.h:115
Class representing bimaterial interface.
std::string errorInfo(const char *func) const
virtual ~EnrichmentFunction()
Destructor.
virtual const char * giveClassName() const
#define _IFT_DiscontinuousFunction_Name
RampFunction(int n, Domain *aDomain)
Abstract class representing global shape function Base class declares abstract interface common to al...
DiscontinuousFunction(int n, Domain *aDomain)
HeavisideFunction(int n, Domain *aDomain)
EnrichmentFunction(int n, Domain *aDomain)
Constructor.
virtual const char * giveInputRecordName() const
virtual const char * giveClassName() const
#define _IFT_RampFunction_Name
Class representing Sign EnrichmentFunction.
virtual void giveJump(std::vector< double > &oJumps) const
Returns the discontinuous jump in the enrichment function when the lvel set function changes sign...
virtual const char * giveClassName() const
Class representing vector of real numbers.
Definition: floatarray.h:82
Class representing a branch function for cohesive cracks.
std::string errorInfo(const char *func) const
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual const char * giveClassName() const
Class representing the general Input Record.
Definition: inputrecord.h:101
Class representing Heaviside EnrichmentFunction.
Class representing the a dynamic Input Record.
virtual void giveJump(std::vector< double > &oJumps) const
Returns the discontinuous jump in the enrichment function when the lvel set function changes sign...
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual const char * giveInputRecordName() const
Class representing the four classical linear elastic branch functions.
The top abstract class of all classes constituting the finite element mesh.
Definition: femcmpnn.h:76
virtual const char * giveClassName() const
virtual const char * giveClassName() const
virtual const char * giveInputRecordName() const

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