OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
scalarfunction.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 scalarfunction_h
36 #define scalarfunction_h
37 
38 #include "parser.h"
39 #include "error.h"
40 #include "gausspoint.h"
41 
42 #include <string>
43 #include <map>
44 
45 namespace oofem {
46 class FunctionArgument;
47 class Domain;
48 class FloatArray;
49 
63 {
65  double dValue;
67  std :: string eValue;
70 
73 
74 public:
83  ScalarFunction(double val);
88  ScalarFunction(std :: string & val);
93  ScalarFunction(int val);
94 
100  void setValue(double val);
101 
106  void setSimpleExpression(std :: string &val);
107 
112  void setReference(int val);
113 
119  double eval(const std :: map< std :: string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const;
120 
126  double eval(double time, Domain *d) const;
127 
129  /*
130  * Evaluates the receiver (convenience function that directly takes just the time and coordinates as parameters).
131  * @param time Time to evaluate for.
132  * @param coords Coordinates to evaluate for.
133  * @param d domain managing external functions
134  */
135  //double eval(double time, const FloatArray &coords, Domain *d) const;
136 
140  bool isDefined() const;
141 
142  friend std :: ostream &operator << ( std :: ostream & out, const ScalarFunction & s );
143 };
144 } // end namespace OOFEM
145 
146 #endif // scalarfunction_h
double dValue
Constant, double value.
double eval(const std::map< std::string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const
Evaluates the receiver.
Class and object Domain.
Definition: domain.h:115
std::string eValue
Simple expression (evaluated by internal parser)
bool isDefined() const
True if receiver is defined.
void setValue(double val)
Sets receiver to be a constant scalar function defined by given value.
friend std::ostream & operator<<(std::ostream &out, const ScalarFunction &s)
void setReference(int val)
Sets receiver to be a scalar function defined using external function.
ScalarFunction()
Creates empty constant scalar function.
void setSimpleExpression(std::string &val)
Sets receiver to be a scalar funtion defined by given simple expression.
int fReference
Reference to external function.
Implementation of Scalar function.
enum oofem::ScalarFunction::@1 dvType
Enum value determining the dataValue type.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Definition: gausspoint.h:93

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