FEDEM Solver  R8.0
Source code of the dynamics solver
Typedefs | Functions
FFaFunctionManager Namespace Reference

Explicit function manager. More...

Typedefs

using IntVec = std::vector< int >
 Convenience type alias. More...
 
using RealVec = std::vector< double >
 Convenience type alias. More...
 

Functions

double getValue (int baseID, const IntVec &intVars, const RealVec &realVars, const double x, int &ierr)
 Evaluates an explicit function. More...
 
double getValue (int baseID, int fType, int extrap, const RealVec &realVars, const double x, int &ierr)
 Evaluates an explicit function. More...
 
double getDerivative (int baseID, int fType, int extrap, const RealVec &realVars, const double x, int &ierr)
 Evaluates the derivative of an explicit function. More...
 
int getSmartPoints (int funcType, int extrap, const double start, const double stop, const RealVec &realVars, RealVec &xtofill, RealVec &ytofill)
 Finds the so-called smart points of an explicit function. More...
 
int getTypeID (const std::string &functionType)
 Returns the function type ID for a given functionType name. More...
 
bool initWaveFunction (const std::string &fileName, const int nWave, const int rSeed, RealVec &realVars)
 Initializes parameters for a wave function from given file. More...
 
bool initWaveFunction (const int iop, const int nWave, const int nDir, const int sprExp, const int rSeed, RealVec &realVars)
 Initializes parameters for a wave function from a wave spectrum. More...
 
bool initWaveFunction (const int iop, const double g, double d, RealVec &realVars)
 Initializes parameters for a non-linear wave function. More...
 
bool initWaveFunction (const int iop, const int nWave, const int rSeed, const double g, const double d, IntVec &intVars, RealVec &realVars)
 Initializes parameters for an embedded non-linear wave function. More...
 
double getWaveValue (const RealVec &realVars, const double g, const double d, const FaVec3 &x, const double t, int iop=0)
 Evaluates a wave profile function. More...
 
double getWaveValue (const IntVec &intVars, const RealVec &realVars, const double g, const double d, const FaVec3 &x, const double t, int iop=0)
 Evaluates a wave profile function. More...
 
double getWaveValue (const IntVec &intVars, const RealVec &realVars, const double g, const double d, const FaVec3 &x, const double t, FaVec3 &v, FaVec3 &a, int iop=0)
 Evaluates a wave profile including velocity and acceleration. More...
 

Detailed Description

Explicit function manager.

Typedef Documentation

◆ IntVec

using FFaFunctionManager::IntVec = typedef std::vector<int>

Convenience type alias.

◆ RealVec

using FFaFunctionManager::RealVec = typedef std::vector<double>

Convenience type alias.

Function Documentation

◆ getDerivative()

double FFaFunctionManager::getDerivative ( int  baseID,
int  fType,
int  extrap,
const RealVec &  realVars,
const double  x,
int &  ierr 
)

Evaluates the derivative of an explicit function.

Parameters
[in]baseIDbase ID of the function to be evaluated
[in]fTypeFunction type identifier
[in]extrapExtrapolation flag
[in]realVarsReal function parameters
[in]xFunction argument
[out]ierrError flag
See also
The fortran routine getfunctionderiv().

◆ getSmartPoints()

int FFaFunctionManager::getSmartPoints ( int  funcType,
int  extrap,
const double  start,
const double  stop,
const RealVec &  realVars,
RealVec &  xtofill,
RealVec &  ytofill 
)

Finds the so-called smart points of an explicit function.

Parameters
[in]funcTypeFunction type identifier
[in]extrapExtrapolation flag
[in]startStart argument value of the function domain to consider
[in]stopStop argument value of the function domain to consider
[in]realVarsReal function parameters
[out]xtofillFunction argument values of the smart points
[out]ytofillFunction values of the smart points
See also
FFaFunctionProperties::getSmartPoints().

◆ getTypeID()

int FFaFunctionManager::getTypeID ( const std::string &  functionType)

Returns the function type ID for a given functionType name.

See also
The fortran routine getfunctiontypeid().

◆ getValue() [1/2]

double FFaFunctionManager::getValue ( int  baseID,
const IntVec &  intVars,
const RealVec &  realVars,
const double  x,
int &  ierr 
)

Evaluates an explicit function.

Parameters
[in]baseIDbase ID of the function to be evaluated
[in]intVarsInteger function parameters
[in]realVarsReal function parameters
[in]xFunction argument
[out]ierrError flag
See also
The fortran routine getfunctionvalue().

◆ getValue() [2/2]

double FFaFunctionManager::getValue ( int  baseID,
int  fType,
int  extrap,
const RealVec &  realVars,
const double  x,
int &  ierr 
)

Evaluates an explicit function.

Parameters
[in]baseIDbase ID of the function to be evaluated
[in]fTypeFunction type identifier
[in]extrapExtrapolation flag
[in]realVarsReal function parameters
[in]xFunction argument
[out]ierrError flag
See also
The fortran routine getfunctionvalue().

◆ getWaveValue() [1/3]

double FFaFunctionManager::getWaveValue ( const IntVec &  intVars,
const RealVec &  realVars,
const double  g,
const double  d,
const FaVec3 &  x,
const double  t,
FaVec3 &  v,
FaVec3 &  a,
int  iop = 0 
)

Evaluates a wave profile including velocity and acceleration.

Parameters
[in]intVarsInteger wave function parameters
[in]realVarsReal wave function parameters
[in]gGravity constant
[in]dWater depth
[in]xPosition to evaluate wave profile at
[in]tTime to evaluate wave profile at
[out]vWater particle velocity
[out]aWater particle acceleration
[in]iopWave model option
Returns
Wave elevation
See also
The fortran routine evalwave().

◆ getWaveValue() [2/3]

double FFaFunctionManager::getWaveValue ( const IntVec &  intVars,
const RealVec &  realVars,
const double  g,
const double  d,
const FaVec3 &  x,
const double  t,
int  iop = 0 
)

Evaluates a wave profile function.

Parameters
[in]intVarsInteger wave function parameters
[in]realVarsReal wave function parameters
[in]gGravity constant
[in]dWater depth
[in]xPosition to evaluate wave profile at
[in]tTime to evaluate wave profile at
[in]iopWave model option
Returns
Wave elevation
See also
The fortran routine waveprofile().

◆ getWaveValue() [3/3]

double FFaFunctionManager::getWaveValue ( const RealVec &  realVars,
const double  g,
const double  d,
const FaVec3 &  x,
const double  t,
int  iop = 0 
)

Evaluates a wave profile function.

Parameters
[in]realVarsReal wave function parameters
[in]gGravity constant
[in]dWater depth
[in]xPosition to evaluate wave profile at
[in]tTime to evaluate wave profile at
[in]iopWave model option
Returns
Wave elevation
See also
The fortran routine waveprofile().

◆ initWaveFunction() [1/4]

bool FFaFunctionManager::initWaveFunction ( const int  iop,
const double  g,
double  d,
RealVec &  realVars 
)

Initializes parameters for a non-linear wave function.

Parameters
[in]iopWave model option
[in]gGravity constant
[in]dWater depth
[out]realVarsReal wave function parameters
See also
The fortran routine initnonlinwavefunc().

◆ initWaveFunction() [2/4]

bool FFaFunctionManager::initWaveFunction ( const int  iop,
const int  nWave,
const int  nDir,
const int  sprExp,
const int  rSeed,
RealVec &  realVars 
)

Initializes parameters for a wave function from a wave spectrum.

Parameters
[in]iopWave spectrum model
[in]nWaveNumber of wave components to generate
[in]nDirNumber of wave directions
[in]sprExpWave spreading exponent
[in]rSeedSeed for (pseudo-)random phase shift
[out]realVarsReal wave function parameters
See also
The fortran routine initwavefuncspectrum().

◆ initWaveFunction() [3/4]

bool FFaFunctionManager::initWaveFunction ( const int  iop,
const int  nWave,
const int  rSeed,
const double  g,
const double  d,
IntVec &  intVars,
RealVec &  realVars 
)

Initializes parameters for an embedded non-linear wave function.

Parameters
[in]iopWave model option
[in]nWaveNumber of wave components
[in]rSeedSeed for (pseudo-)random phase shift
[in]gGravity constant
[in]dWater depth
[out]intVarsInteger wave function parameters
[out]realVarsReal wave function parameters
See also
The fortran routine initembeddedwave().

◆ initWaveFunction() [4/4]

bool FFaFunctionManager::initWaveFunction ( const std::string &  fileName,
const int  nWave,
const int  rSeed,
RealVec &  realVars 
)

Initializes parameters for a wave function from given file.

Parameters
[in]fileNameName of file to read parameters from
[in]nWaveNumber of wave components to read
[in]rSeedSeed for (pseudo-)random phase shift
[out]realVarsReal wave function parameters
See also
The fortran routine initwavefuncfromfile().