Sundance::Deriv Class Reference

Inheritance diagram for Sundance::Deriv:

Sundance::EnumTypeField< DerivType >

List of all members.

Public Member Functions

 Deriv ()
 Deriv (int coordDir)
 Deriv (const SymbolicFuncElement *func, const SpatialDerivSpecifier &d)
 Deriv (const SymbolicFunc *func, const SpatialDerivSpecifier &d)
bool operator< (const Deriv &other) const
bool operator== (const Deriv &other) const
std::string toString (bool verbose=false) const
bool isCoordDeriv () const
bool isFunctionalDeriv () const
bool isTestFunction () const
bool isUnknownFunction () const
bool isParameter () const
Deriv derivWrtMultiIndex (const MultiIndex &mi) const
bool canBeDifferentiated () const
int dofID () const
 Return the DOF ID of my operative function, for example, if I am $\frac{\partial}{\partial D_y u_x}$ then return dofID$({\bf u})$. If I'm not a functional derivative, throw an error.
const FunctionIdentifierfid () const
const SpatialDerivSpecifieropOnFunc () const
const AlgebraSpecifieralgSpec () const
const AlgebraSpecifierfuncAlgSpec () const
RCP< const CommonFuncDataStubdata () const
int coordDerivDir () const
const SymbolicFuncElementsymbFuncElem () const
const SymbolicFuncsymbFunc () const

Private Member Functions

const SymbolicFuncDescriptorsfdPtr () const
void checkConsistencyOfOperations () const

Static Private Member Functions

static AlgebraSpecifier derivAlgSpec (const AlgebraSpecifier &a, const SpatialDerivSpecifier &sds)

Private Attributes

AlgebraSpecifier myAlgSpec_
FunctionIdentifier fid_
SpatialDerivSpecifier sds_
const SymbolicFuncElementsymbFuncElem_
const SymbolicFuncsymbFunc_
int coordDerivDir_

Related Functions

(Note that these are not member functions.)

Deriv coordDeriv (int d)
Deriv coordDeriv (const MultiIndex &mi)
Deriv funcDeriv (const SymbolicFuncElement *symbFunc)
Deriv funcDeriv (const SymbolicFuncElement *symbFunc, const MultiIndex &mi)
Deriv funcDeriv (const SymbolicFunc *symbFunc)
Deriv funcDeriv (const SymbolicFunc *symbFunc, const MultiIndex &mi)
Deriv normalDeriv (const SymbolicFuncElement *symbFunc)


Detailed Description

The purpose of this class is to represent first-order spatial or functional differential operators. This object should not be confused with the user-level Derivative object, which represents spatial differential operators as appearing in a user-level problem specification.

Functional vs spatial derivatives

The bridge theorem involves expressions of the form

\[ \frac{\partial \mathcal{F}}{\partial L(u)} L(\phi_u) \]

and

\[ \frac{\partial^2 \mathcal{F}}{\partial L(u)\partial M(v)} L(\phi_u)M(\psi_v) \]

where $L(u)$ is some spatial differential operator acting on the function $u$, and $\phi_u$ is a basis function with which $u$ is represented. A derivative such as $\frac{\partial \mathcal{F}}{\partial L(u)}$ will be called a functional derivative to distinguish it from derivatives with respect to spatial coordinates, such as $\frac{\partial \mathcal{F}}{\partial x}$. The following table shows the types of derivative currently supported.
Operation Geometry of derivative value Operating function geometry Operating spatial operator Operating function subtype
$ \frac{\partial}{\partial x}$ Scalar Coordinate component N/A N/A
$ \frac{\partial}{\partial p}$ Scalar Scalar ($L^2$) Identity SymbolicFuncElement
$ \frac{\partial}{\partial D_\alpha p}$ Coordinate component Scalar ($H^1$) Partial derivative $D_\alpha$ SymbolicFuncElement
$ \frac{\partial}{\partial D_n p}$ Normal component Scalar ($H^1$) Normal derivative ${\bf n}\cdot \nabla$ SymbolicFuncElement
$ \frac{\partial}{\partial \mathrm{div}({\bf u})}$ Scalar Vector (${\bf H}(div)$) Divergence SymbolicFunc
$ \frac{\partial}{\partial {\bf u\cdot e_\alpha}}$ Coordinate component Vector (${\bf H}^1$, ${\bf H}(div)$, or ${\bf H}(curl)$) Inner product with coordinate unit vector SymbolicFuncElement
$ \frac{\partial}{\partial {\bf u\cdot n}}$ Normal component Vector (${\bf H}^1$ or ${\bf H}(div)$) Inner product with normal unit vector SymbolicFunc
$ \frac{\partial}{\partial D_\alpha ({\bf u\cdot e_\beta})}$ Coordinate component Vector (${\bf H}^1$) Inner product with normal unit vector SymbolicFuncElement

Definition at line 143 of file SundanceDeriv.hpp.


Constructor & Destructor Documentation

Deriv::Deriv (  ) 

An empty ctor is needed for use with std::vector. The empty ctor creates a null derivative, representing an identity operator.

Definition at line 49 of file SundanceDeriv.cpp.

Referenced by derivWrtMultiIndex().

Deriv::Deriv ( int  coordDir  ) 

Construct a deriv wrt a coordinate, e.g., $D_x$.

Definition at line 54 of file SundanceDeriv.cpp.

Deriv::Deriv ( const SymbolicFuncElement func,
const SpatialDerivSpecifier d 
)

Construct a deriv wrt an object of length one, for example, a scalar function or a single component of a vector function, or possibly a spatial derivative of such an object. Examples:

  • $T$ is a scalar-valued function

Definition at line 62 of file SundanceDeriv.cpp.

References Sundance::FunctionIdentifier::algSpec(), checkConsistencyOfOperations(), derivAlgSpec(), Sundance::FunctionWithID::fid(), fid_, and myAlgSpec_.

Deriv::Deriv ( const SymbolicFunc func,
const SpatialDerivSpecifier d 
)


Member Function Documentation

const AlgebraSpecifier& Sundance::Deriv::algSpec (  )  const [inline]

Indicate my algebra type

Definition at line 227 of file SundanceDeriv.hpp.

References myAlgSpec_.

bool Deriv::canBeDifferentiated (  )  const

void Deriv::checkConsistencyOfOperations (  )  const [private]

int Deriv::coordDerivDir (  )  const

If I am a coordinate derivative, return my direction

Definition at line 229 of file SundanceDeriv.cpp.

References Sundance::EnumTypeField< DerivType >::assertType(), coordDerivDir_, and Sundance::CoordDT.

Referenced by Sundance::DiffOpEvaluator::DiffOpEvaluator(), operator<(), and toString().

RCP< const CommonFuncDataStub > Deriv::data (  )  const

AlgebraSpecifier Deriv::derivAlgSpec ( const AlgebraSpecifier a,
const SpatialDerivSpecifier sds 
) [static, private]

Deriv Deriv::derivWrtMultiIndex ( const MultiIndex mi  )  const

Create a new functional derivative in which the function has been differentiated spatially by the given multi index, for example, derivWrtMultiIndex(MultiIndex(0,0,1)) transforms $\frac{\partial}{\partial p}$ to $\frac{\partial}{\partial D_z p}$

Definition at line 259 of file SundanceDeriv.cpp.

References Sundance::EnumTypeField< DerivType >::assertType(), Deriv(), Sundance::SpatialDerivSpecifier::derivWrtMultiIndex(), Sundance::FunctionalDT, Sundance::SpatialDerivSpecifier::isDivergence(), isParameter(), Sundance::MultiIndex::order(), sds_, symbFunc_, and symbFuncElem_.

Referenced by Sundance::applyTx().

int Deriv::dofID (  )  const

Return the DOF ID of my operative function, for example, if I am $\frac{\partial}{\partial D_y u_x}$ then return dofID$({\bf u})$. If I'm not a functional derivative, throw an error.

Definition at line 210 of file SundanceDeriv.cpp.

References Sundance::EnumTypeField< DerivType >::assertType(), Sundance::FunctionIdentifier::dofID(), fid_, and Sundance::FunctionalDT.

const FunctionIdentifier & Deriv::fid (  )  const

const AlgebraSpecifier & Deriv::funcAlgSpec (  )  const

Indicate the algebra type of my operative function

Definition at line 216 of file SundanceDeriv.cpp.

References Sundance::FunctionIdentifier::algSpec(), Sundance::EnumTypeField< DerivType >::assertType(), fid_, and Sundance::FunctionalDT.

bool Sundance::Deriv::isCoordDeriv (  )  const [inline]

True if this is a derivative wrt a spatial coordinate

Definition at line 186 of file SundanceDeriv.hpp.

References Sundance::CoordDT, and Sundance::EnumTypeField< DerivType >::type().

Referenced by Sundance::DiffOpEvaluator::backedDerivs(), and Sundance::DiffOpEvaluator::DiffOpEvaluator().

bool Sundance::Deriv::isFunctionalDeriv (  )  const [inline]

bool Deriv::isParameter (  )  const

True if my operative function is a parameter

Definition at line 201 of file SundanceDeriv.cpp.

References isFunctionalDeriv(), Sundance::SymbolicFuncDescriptor::isParameter(), and sfdPtr().

Referenced by canBeDifferentiated(), derivWrtMultiIndex(), and Sundance::GrouperBase::extractWeakForm().

bool Deriv::isTestFunction (  )  const

True if my operative function is a test function

Definition at line 182 of file SundanceDeriv.cpp.

References isFunctionalDeriv(), Sundance::SymbolicFuncDescriptor::isTestFunction(), and sfdPtr().

bool Deriv::isUnknownFunction (  )  const

True if my operative function is unknown

Definition at line 191 of file SundanceDeriv.cpp.

References isFunctionalDeriv(), Sundance::SymbolicFuncDescriptor::isUnknownFunction(), and sfdPtr().

bool Deriv::operator< ( const Deriv other  )  const

Comparison operator for use in sets and maps

Definition at line 104 of file SundanceDeriv.cpp.

References coordDerivDir(), Sundance::CoordDT, fid(), sds_, Sundance::EnumTypeField< T >::type(), and Sundance::EnumTypeField< DerivType >::type().

bool Deriv::operator== ( const Deriv other  )  const

Equality test operator

Definition at line 122 of file SundanceDeriv.cpp.

const SpatialDerivSpecifier & Deriv::opOnFunc (  )  const

const SymbolicFuncDescriptor * Deriv::sfdPtr (  )  const [private]

const SymbolicFunc* Sundance::Deriv::symbFunc (  )  const [inline]

Return a pointer to my operative function

Definition at line 242 of file SundanceDeriv.hpp.

References symbFunc_.

const SymbolicFuncElement* Sundance::Deriv::symbFuncElem (  )  const [inline]

Return a pointer to my operative function

Definition at line 239 of file SundanceDeriv.hpp.

References symbFuncElem_.

Referenced by Sundance::DiffOpEvaluator::DiffOpEvaluator(), and Sundance::GrouperBase::extractWeakForm().

std::string Deriv::toString ( bool  verbose = false  )  const

Write to a std::string

Parameters:
verbose If true, write all details for the object. If false, write a simple description giving only the function name and the specification of a derivative.

Definition at line 127 of file SundanceDeriv.cpp.

References coordDerivDir(), Sundance::CoordDT, Sundance::MultiIndex::firstOrderDirection(), Sundance::FunctionalDT, Sundance::SpatialDerivSpecifier::mi(), Sundance::NullDT, opOnFunc(), symbFunc_, symbFuncElem_, Sundance::ExprBase::toString(), and Sundance::EnumTypeField< DerivType >::type().


Friends And Related Function Documentation

Deriv coordDeriv ( const MultiIndex mi  )  [related]

Definition at line 322 of file SundanceDeriv.cpp.

Deriv coordDeriv ( int  d  )  [related]

Deriv funcDeriv ( const SymbolicFunc symbFunc,
const MultiIndex mi 
) [related]

Definition at line 345 of file SundanceDeriv.cpp.

Deriv funcDeriv ( const SymbolicFunc symbFunc  )  [related]

Definition at line 339 of file SundanceDeriv.cpp.

Deriv funcDeriv ( const SymbolicFuncElement symbFunc,
const MultiIndex mi 
) [related]

Definition at line 333 of file SundanceDeriv.cpp.

Deriv funcDeriv ( const SymbolicFuncElement symbFunc  )  [related]

Definition at line 328 of file SundanceDeriv.cpp.

Deriv normalDeriv ( const SymbolicFuncElement symbFunc  )  [related]

Definition at line 352 of file SundanceDeriv.cpp.


Member Data Documentation

Definition at line 265 of file SundanceDeriv.hpp.

Referenced by coordDerivDir().

Definition at line 257 of file SundanceDeriv.hpp.

Referenced by checkConsistencyOfOperations(), Deriv(), dofID(), fid(), and funcAlgSpec().

Definition at line 255 of file SundanceDeriv.hpp.

Referenced by algSpec(), and Deriv().

Definition at line 263 of file SundanceDeriv.hpp.

Referenced by data(), derivWrtMultiIndex(), sfdPtr(), symbFunc(), and toString().

Definition at line 261 of file SundanceDeriv.hpp.

Referenced by data(), derivWrtMultiIndex(), sfdPtr(), symbFuncElem(), and toString().

Site Contact