MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
grad::UnaryExpr< UnFunc, Expr > Class Template Reference

#include <gradient.h>

Collaboration diagram for grad::UnaryExpr< UnFunc, Expr >:

Public Types

typedef Expr::GradientType GradientType
 
typedef
GradientType::scalar_func_type 
scalar_func_type
 
typedef
GradientType::scalar_deriv_type 
scalar_deriv_type
 
typedef
GradientType::vector_deriv_type 
vector_deriv_type
 

Public Member Functions

 UnaryExpr (const Expr &u)
 
scalar_func_type dGetValue () const
 
scalar_deriv_type dGetDerivativeLocal (index_type iLocalDof) const
 
vector_deriv_type dGetDerivativeLocalVector (index_type iLocalVecDof) const
 
index_type iGetStartIndexLocal () const
 
index_type iGetEndIndexLocal () const
 
index_type iGetStartIndexLocalVector () const
 
index_type iGetEndIndexLocalVector () const
 
LocalDofMappGetDofMap () const
 
bool bHaveReferenceTo (const void *p) const
 
void Compute () const
 

Static Public Member Functions

static index_type iGetMaxDerivatives ()
 

Static Public Attributes

static const bool bAlias = Expr::bAlias
 
static const index_type iMaxDerivatives = Expr::iMaxDerivatives
 
static const bool bVectorize = Expr::bVectorize && UnFunc::bVectorize
 
static const index_type iDimension = GradientType::iDimension
 

Private Member Functions

template<typename T >
EvalDeriv (T du_dX) const
 

Private Attributes

const Expr oU
 
scalar_func_type f
 
scalar_deriv_type df_du
 

Detailed Description

template<typename UnFunc, typename Expr>
class grad::UnaryExpr< UnFunc, Expr >

Definition at line 1439 of file gradient.h.

Member Typedef Documentation

template<typename UnFunc , typename Expr >
typedef Expr::GradientType grad::UnaryExpr< UnFunc, Expr >::GradientType

Definition at line 1444 of file gradient.h.

template<typename UnFunc , typename Expr >
typedef GradientType::scalar_deriv_type grad::UnaryExpr< UnFunc, Expr >::scalar_deriv_type

Definition at line 1447 of file gradient.h.

template<typename UnFunc , typename Expr >
typedef GradientType::scalar_func_type grad::UnaryExpr< UnFunc, Expr >::scalar_func_type

Definition at line 1446 of file gradient.h.

template<typename UnFunc , typename Expr >
typedef GradientType::vector_deriv_type grad::UnaryExpr< UnFunc, Expr >::vector_deriv_type

Definition at line 1448 of file gradient.h.

Constructor & Destructor Documentation

template<typename UnFunc , typename Expr >
grad::UnaryExpr< UnFunc, Expr >::UnaryExpr ( const Expr &  u)
inline

Definition at line 1450 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du, and grad::UnaryExpr< UnFunc, Expr >::f.

1451  :oU(u) {
1452 #if GRADIENT_DEBUG > 0
1453  f = df_du = NAN;
1454 #endif
1455  }
const Expr oU
Definition: gradient.h:1531
scalar_func_type f
Definition: gradient.h:1532
scalar_deriv_type df_du
Definition: gradient.h:1533

Member Function Documentation

template<typename UnFunc , typename Expr >
bool grad::UnaryExpr< UnFunc, Expr >::bHaveReferenceTo ( const void *  p) const
inline

Definition at line 1502 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1502  {
1503  return oU.bHaveReferenceTo(p);
1504  }
const Expr oU
Definition: gradient.h:1531
template<typename UnFunc , typename Expr >
void grad::UnaryExpr< UnFunc, Expr >::Compute ( ) const
inline

Definition at line 1510 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du, grad::UnaryExpr< UnFunc, Expr >::f, GRADIENT_ASSERT, and grad::UnaryExpr< UnFunc, Expr >::oU.

1510  {
1511  GRADIENT_ASSERT(std::isnan(f));
1512  GRADIENT_ASSERT(std::isnan(df_du));
1513 
1514  oU.Compute();
1515 
1516  const scalar_func_type u = oU.dGetValue();
1517 
1518  f = UnFunc::f(u);
1519  df_du = UnFunc::df_du(u);
1520  }
const Expr oU
Definition: gradient.h:1531
GradientType::scalar_func_type scalar_func_type
Definition: gradient.h:1446
scalar_func_type f
Definition: gradient.h:1532
scalar_deriv_type df_du
Definition: gradient.h:1533
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74
template<typename UnFunc , typename Expr >
scalar_deriv_type grad::UnaryExpr< UnFunc, Expr >::dGetDerivativeLocal ( index_type  iLocalDof) const
inline

Definition at line 1464 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du, grad::UnaryExpr< UnFunc, Expr >::EvalDeriv(), grad::UnaryExpr< UnFunc, Expr >::f, GRADIENT_ASSERT, and grad::UnaryExpr< UnFunc, Expr >::oU.

1464  {
1465  GRADIENT_ASSERT(!std::isnan(f));
1466  GRADIENT_ASSERT(!std::isnan(df_du));
1467 
1468  const scalar_deriv_type du_dX = oU.dGetDerivativeLocal(iLocalDof);
1469 
1470  return EvalDeriv(du_dX);
1471  }
const Expr oU
Definition: gradient.h:1531
scalar_func_type f
Definition: gradient.h:1532
GradientType::scalar_deriv_type scalar_deriv_type
Definition: gradient.h:1447
scalar_deriv_type df_du
Definition: gradient.h:1533
T EvalDeriv(T du_dX) const
Definition: gradient.h:1525
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74

Here is the call graph for this function:

template<typename UnFunc , typename Expr >
vector_deriv_type grad::UnaryExpr< UnFunc, Expr >::dGetDerivativeLocalVector ( index_type  iLocalVecDof) const
inline

Definition at line 1473 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du, grad::UnaryExpr< UnFunc, Expr >::EvalDeriv(), grad::UnaryExpr< UnFunc, Expr >::f, GRADIENT_ASSERT, and grad::UnaryExpr< UnFunc, Expr >::oU.

1473  {
1474  GRADIENT_ASSERT(!std::isnan(f));
1475  GRADIENT_ASSERT(!std::isnan(df_du));
1476 
1477  const vector_deriv_type du_dX = oU.dGetDerivativeLocalVector(iLocalVecDof);
1478 
1479  return EvalDeriv(du_dX);
1480  }
GradientType::vector_deriv_type vector_deriv_type
Definition: gradient.h:1448
const Expr oU
Definition: gradient.h:1531
scalar_func_type f
Definition: gradient.h:1532
scalar_deriv_type df_du
Definition: gradient.h:1533
T EvalDeriv(T du_dX) const
Definition: gradient.h:1525
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74

Here is the call graph for this function:

template<typename UnFunc , typename Expr >
scalar_func_type grad::UnaryExpr< UnFunc, Expr >::dGetValue ( ) const
inline

Definition at line 1457 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du, grad::UnaryExpr< UnFunc, Expr >::f, and GRADIENT_ASSERT.

1457  {
1458  GRADIENT_ASSERT(!std::isnan(f));
1459  GRADIENT_ASSERT(!std::isnan(df_du));
1460 
1461  return f;
1462  }
scalar_func_type f
Definition: gradient.h:1532
scalar_deriv_type df_du
Definition: gradient.h:1533
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74
template<typename UnFunc , typename Expr >
template<typename T >
T grad::UnaryExpr< UnFunc, Expr >::EvalDeriv ( du_dX) const
inlineprivate

Definition at line 1525 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::df_du.

Referenced by grad::UnaryExpr< UnFunc, Expr >::dGetDerivativeLocal(), and grad::UnaryExpr< UnFunc, Expr >::dGetDerivativeLocalVector().

1526  {
1527  return df_du * du_dX;
1528  }
scalar_deriv_type df_du
Definition: gradient.h:1533
template<typename UnFunc , typename Expr >
index_type grad::UnaryExpr< UnFunc, Expr >::iGetEndIndexLocal ( ) const
inline

Definition at line 1486 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1486  {
1487  return oU.iGetEndIndexLocal();
1488  }
const Expr oU
Definition: gradient.h:1531
template<typename UnFunc , typename Expr >
index_type grad::UnaryExpr< UnFunc, Expr >::iGetEndIndexLocalVector ( ) const
inline

Definition at line 1494 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1494  {
1495  return oU.iGetEndIndexLocalVector();
1496  }
const Expr oU
Definition: gradient.h:1531
template<typename UnFunc , typename Expr >
static index_type grad::UnaryExpr< UnFunc, Expr >::iGetMaxDerivatives ( )
inlinestatic

Definition at line 1506 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::iMaxDerivatives.

1506  {
1507  return iMaxDerivatives;
1508  }
static const index_type iMaxDerivatives
Definition: gradient.h:1442
template<typename UnFunc , typename Expr >
index_type grad::UnaryExpr< UnFunc, Expr >::iGetStartIndexLocal ( ) const
inline

Definition at line 1482 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1482  {
1483  return oU.iGetStartIndexLocal();
1484  }
const Expr oU
Definition: gradient.h:1531
template<typename UnFunc , typename Expr >
index_type grad::UnaryExpr< UnFunc, Expr >::iGetStartIndexLocalVector ( ) const
inline

Definition at line 1490 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1490  {
1491  return oU.iGetStartIndexLocalVector();
1492  }
const Expr oU
Definition: gradient.h:1531
template<typename UnFunc , typename Expr >
LocalDofMap* grad::UnaryExpr< UnFunc, Expr >::pGetDofMap ( ) const
inline

Definition at line 1498 of file gradient.h.

References grad::UnaryExpr< UnFunc, Expr >::oU.

1498  {
1499  return oU.pGetDofMap();
1500  }
const Expr oU
Definition: gradient.h:1531

Member Data Documentation

template<typename UnFunc , typename Expr >
const bool grad::UnaryExpr< UnFunc, Expr >::bAlias = Expr::bAlias
static

Definition at line 1441 of file gradient.h.

template<typename UnFunc , typename Expr >
const bool grad::UnaryExpr< UnFunc, Expr >::bVectorize = Expr::bVectorize && UnFunc::bVectorize
static

Definition at line 1443 of file gradient.h.

template<typename UnFunc , typename Expr >
const index_type grad::UnaryExpr< UnFunc, Expr >::iDimension = GradientType::iDimension
static

Definition at line 1445 of file gradient.h.

template<typename UnFunc , typename Expr >
const index_type grad::UnaryExpr< UnFunc, Expr >::iMaxDerivatives = Expr::iMaxDerivatives
static

Definition at line 1442 of file gradient.h.

Referenced by grad::UnaryExpr< UnFunc, Expr >::iGetMaxDerivatives().


The documentation for this class was generated from the following file: