1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
|
/*
* Copyright (c) 2017, Miroslav Stoyanov
*
* This file is part of
* Toolkit for Adaptive Stochastic Modeling And Non-Intrusive ApproximatioN: TASMANIAN
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
* and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* UT-BATTELLE, LLC AND THE UNITED STATES GOVERNMENT MAKE NO REPRESENTATIONS AND DISCLAIM ALL WARRANTIES, BOTH EXPRESSED AND IMPLIED.
* THERE ARE NO EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY PATENT,
* COPYRIGHT, TRADEMARK, OR OTHER PROPRIETARY RIGHTS, OR THAT THE SOFTWARE WILL ACCOMPLISH THE INTENDED RESULTS OR THAT THE SOFTWARE OR ITS USE WILL NOT RESULT IN INJURY OR DAMAGE.
* THE USER ASSUMES RESPONSIBILITY FOR ALL LIABILITIES, PENALTIES, FINES, CLAIMS, CAUSES OF ACTION, AND COSTS AND EXPENSES, CAUSED BY, RESULTING FROM OR ARISING OUT OF,
* IN WHOLE OR IN PART THE USE, STORAGE OR DISPOSAL OF THE SOFTWARE.
*/
#ifndef __TASMANIAN_TASGRID_FUNCTIONS_HPP
#define __TASMANIAN_TASGRID_FUNCTIONS_HPP
class BaseFunction{
public:
BaseFunction();
~BaseFunction();
virtual int getNumInputs() const = 0;
virtual int getNumOutputs() const = 0;
virtual const char* getDescription() const = 0;
virtual void eval(const double x[], double y[]) const = 0;
virtual void getIntegral(double y[]) const = 0;
virtual void getDerivative (const double x[], double y[]) const = 0;
};
class OneOneP0: public BaseFunction{
public:
OneOneP0(); ~OneOneP0();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class OneOneP3: public BaseFunction{
public:
OneOneP3(); ~OneOneP3();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class OneOneP4: public BaseFunction{
public:
OneOneP4(); ~OneOneP4();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class OneOneExpMX: public BaseFunction{
public:
OneOneExpMX(); ~OneOneExpMX();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneP4: public BaseFunction{
public:
TwoOneP4(); ~TwoOneP4();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneP5: public BaseFunction{
public:
TwoOneP5(); ~TwoOneP5();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneExpNX2: public BaseFunction{
public:
TwoOneExpNX2(); ~TwoOneExpNX2();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class ThreeOneExpNX2: public BaseFunction{
public:
ThreeOneExpNX2(); ~ThreeOneExpNX2();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneCos: public BaseFunction{
public:
TwoOneCos(); ~TwoOneCos();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneSinSin: public BaseFunction{
public:
TwoOneSinSin(); ~TwoOneSinSin();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneCosCos: public BaseFunction{
public:
TwoOneCosCos(); ~TwoOneCosCos();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneExpSinCos : public BaseFunction{
public:
TwoOneExpSinCos(); ~TwoOneExpSinCos();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneSinCosAxis : public BaseFunction{
public:
TwoOneSinCosAxis(); ~TwoOneSinCosAxis();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoTwoSinCos : public BaseFunction{
public:
TwoTwoSinCos(); ~TwoTwoSinCos();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneExpm40: public BaseFunction{
public:
TwoOneExpm40(); ~TwoOneExpm40();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class FiveOneExpSum: public BaseFunction{
public:
FiveOneExpSum(); ~FiveOneExpSum();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class SixOneExpSum: public BaseFunction{
public:
SixOneExpSum(); ~SixOneExpSum();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class EightOneCosSum: public BaseFunction{
public:
EightOneCosSum(); ~EightOneCosSum();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class ThreeOneUnitBall: public BaseFunction{
public:
ThreeOneUnitBall(); ~ThreeOneUnitBall();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
// Function to test special integration rules, i.e. integrals against weight functions
class TwoOneConstGC1: public BaseFunction{
public:
TwoOneConstGC1(); ~TwoOneConstGC1();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConstGC2: public BaseFunction{
public:
TwoOneConstGC2(); ~TwoOneConstGC2();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConstGG: public BaseFunction{
public:
TwoOneConstGG(); ~TwoOneConstGG();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConstGJ: public BaseFunction{
public:
TwoOneConstGJ(); ~TwoOneConstGJ();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConstGGL: public BaseFunction{
public:
TwoOneConstGGL(); ~TwoOneConstGGL();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConstGH: public BaseFunction{
public:
TwoOneConstGH(); ~TwoOneConstGH();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneENX2aniso: public BaseFunction{
public:
TwoOneENX2aniso(); ~TwoOneENX2aniso();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoTwoExpAsym: public BaseFunction{
public:
TwoTwoExpAsym(); ~TwoTwoExpAsym();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class SixteenOneActive3: public BaseFunction{
public:
SixteenOneActive3(); ~SixteenOneActive3();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneDivisionAnisotropic: public BaseFunction{
public:
TwoOneDivisionAnisotropic(); ~TwoOneDivisionAnisotropic();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOne1DCurved: public BaseFunction{
public:
TwoOne1DCurved(); ~TwoOne1DCurved();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneExpShiftedDomain: public BaseFunction{
public:
TwoOneExpShiftedDomain(); ~TwoOneExpShiftedDomain();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class OneOneConformalOne: public BaseFunction{
public:
OneOneConformalOne(); ~OneOneConformalOne();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneConformalOne: public BaseFunction{
public:
TwoOneConformalOne(); ~TwoOneConformalOne();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class Two3KExpSinCos: public BaseFunction{
public:
Two3KExpSinCos(); ~Two3KExpSinCos();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
class TwoOneC1C2Periodic: public BaseFunction{
public:
TwoOneC1C2Periodic(); ~TwoOneC1C2Periodic();
int getNumInputs() const; int getNumOutputs() const; const char* getDescription() const; void eval(const double x[], double y[]) const; void getIntegral(double y[]) const; void getDerivative (const double x[], double y[]) const;
};
#endif
|