Loading...
Searching...
No Matches
SwitchingFunction.cpp File Reference
#include "SwitchingFunction.h"
#include "Tools.h"
#include "Keywords.h"
#include "OpenMP.h"
#include <cmath>
#include <vector>
#include <limits>
#include <algorithm>

Classes

struct  PLMD::switchContainers::baseSwitch< switching >
 container for the actual switching function used by PLMD::SwitchingFunction More...
 
struct  PLMD::switchContainers::cosinusSwitch
 
struct  PLMD::switchContainers::cubicSwitch
 
struct  PLMD::switchContainers::exponentialSwitch
 
struct  PLMD::switchContainers::fastgaussianSwitch
 
struct  PLMD::switchContainers::fixedRational< N,, >
 
class  PLMD::switchContainers::leptonSwitch::funcAndDeriv
 Lepton expression. More...
 
struct  PLMD::switchContainers::gaussianSwitch
 
class  PLMD::switchContainers::leptonSwitch
 
struct  PLMD::switchContainers::nativeqSwitch
 
struct  PLMD::switchContainers::rational< isFast, nis2m >
 
struct  PLMD::switchContainers::smapSwitch
 
class  PLMD::switchContainers::SwitchInterface< SF >
 
class  PLMD::switchContainers::SwitchInterface_lepton
 
struct  PLMD::switchContainers::tanhSwitch
 

Namespaces

namespace  PLMD
 
namespace  PLMD::switchContainers
 
namespace  PLMD::switchContainers::switchContainersUtils
 

Macros

#define CHECKandPARSE(datastring, keyword, variable, errormsg)
 
#define CHECKandPARSE(datastring, keyword, variable, errormsg)
 
#define DEFAULTPRINT(x)
 
#define FIXEDRATIONALENUM(x)
 
#define FIXEDRATIONALENUM(x)
 
#define RATCALL(x)
 
#define RATCALL(x)
 
#define RATCALL(x)
 
#define RATFIX(N)
 
#define REQUIREDPARSE(datastring, keyword, variable, errormsg)
 
#define REQUIREDPARSE(datastring, keyword, variable, errormsg)
 
#define SWITCHCALL(x)
 
#define SWITCHCALL(x)
 
#define SWITCHCALL(x)
 

Typedefs

using PLMD::switchContainers::ValueDerivative = std::pair<double,double>
 

Enumerations

enum class  PLMD::switchContainers::rationalForm : bool { PLMD::switchContainers::standard , PLMD::switchContainers::simplified }
 
enum class  PLMD::switchContainers::rationalPow : bool { PLMD::switchContainers::standard , PLMD::switchContainers::fast }
 

Functions

ValueDerivative PLMD::switchContainers::applystretch (const Data &data, double distance, ValueDerivative in)
 
ValueDerivative PLMD::switchContainers::calculate (const switchType type, const Data &data, const double rdist)
 
ValueDerivative PLMD::switchContainers::calculateSqr (const switchType type, const Data &data, const double rdist2)
 
std::string PLMD::switchContainers::description (switchType type, const Data &data)
 
std::pair< switchType, DataPLMD::switchContainers::initRational (double D0, double DMAX, double R0, int N, int M)
 
std::unique_ptr< SwitchPLMD::switchContainers::rationalFactory (double D0, double DMAX, double R0, int N, int M)
 
void PLMD::switchContainers::removeStretch (Data &data)
 
void PLMD::switchContainers::setupStretch (switchType type, Data &data)
 
std::string PLMD::switchContainers::typeToString (switchType type)
 

Variables

template<class, class = void>
constexpr bool PLMD::switchContainers::switchContainersUtils::has_function_data = false
 
template<class T>
constexpr bool PLMD::switchContainers::switchContainersUtils::has_function_data< T, std::void_t< decltype(T::function(std::declval< const Data & >(), std::declval< double >()))> > = true
 

Macro Definition Documentation

◆ CHECKandPARSE [1/2]

#define CHECKandPARSE ( datastring,
keyword,
variable,
errormsg )
Value:
if(Tools::findKeyword(datastring,keyword) && !Tools::parse(datastring,keyword,variable))\
errormsg="could not parse " keyword;

◆ CHECKandPARSE [2/2]

#define CHECKandPARSE ( datastring,
keyword,
variable,
errormsg )
Value:
if(Tools::findKeyword(datastring,keyword) && !Tools::parse(datastring,keyword,variable))\
errormsg="could not parse " keyword;

◆ DEFAULTPRINT

#define DEFAULTPRINT ( x)
Value:
case switchType::x: return #x;

◆ FIXEDRATIONALENUM [1/2]

#define FIXEDRATIONALENUM ( x)
Value:
case x: \
return std::make_unique<SwitchInterface<fixedRational<x>>>( \
std::pair <switchType,Data> {switchType::rationalfix##x,Data::init(D0,DMAX,R0)});

◆ FIXEDRATIONALENUM [2/2]

#define FIXEDRATIONALENUM ( x)
Value:
case x: \
return std::pair <switchType,Data> {switchType::rationalfix##x,Data::init(D0,DMAX,R0)};

◆ RATCALL [1/3]

#define RATCALL ( x)
Value:
case switchType::rationalfix##x:return fixedRational<x>::calculate(data, rdist);

◆ RATCALL [2/3]

#define RATCALL ( x)
Value:
case switchType::rationalfix##x:return fixedRational<x>::calculateSqr(data, rdist2);

◆ RATCALL [3/3]

#define RATCALL ( x)
Value:
case switchType::rationalfix##x:\
function = std::make_unique<SwitchInterface<fixedRational<x>>>(settings); \
break;

◆ RATFIX

#define RATFIX ( N)
Value:
case switchType::rationalfix##N: \
ostr<< " " << " nn=" << N << " mm=" <<N*2; \
break;

◆ REQUIREDPARSE [1/2]

#define REQUIREDPARSE ( datastring,
keyword,
variable,
errormsg )
Value:
if(!Tools::parse(datastring,keyword,variable))\
errormsg=keyword " is required for " + name ;

◆ REQUIREDPARSE [2/2]

#define REQUIREDPARSE ( datastring,
keyword,
variable,
errormsg )
Value:
if(!Tools::parse(datastring,keyword,variable))\
errormsg=keyword " is required for " + name ;

◆ SWITCHCALL [1/3]

#define SWITCHCALL ( x)
Value:
case switchType::x: return x##Switch::calculate(data, rdist);

◆ SWITCHCALL [2/3]

#define SWITCHCALL ( x)
Value:
case switchType::x: return x##Switch::calculateSqr(data, rdist2);

◆ SWITCHCALL [3/3]

#define SWITCHCALL ( x)
Value:
case switchType::x: \
function = std::make_unique<SwitchInterface<x##Switch>>(settings); \
break;