Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Related Functions
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 154 of file SundanceDeriv.hpp.


Constructor & Destructor Documentation

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

Definition at line 60 of file SundanceDeriv.cpp.

Referenced by derivWrtMultiIndex().

Deriv::Deriv ( int  coordDir)

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

Definition at line 65 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 73 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 238 of file SundanceDeriv.hpp.

References myAlgSpec_.

void Deriv::checkConsistencyOfOperations ( ) const [private]
int Deriv::coordDerivDir ( ) const

If I am a coordinate derivative, return my direction

Definition at line 240 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]

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 270 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 221 of file SundanceDeriv.cpp.

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

const FunctionIdentifier & Deriv::fid ( ) const

Indicate the algebra type of my operative function

Definition at line 227 of file SundanceDeriv.cpp.

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

Referenced by derivAlgSpec().

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

True if this is a derivative wrt a spatial coordinate

Definition at line 197 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 212 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 193 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 202 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 115 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 133 of file SundanceDeriv.cpp.

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

Return a pointer to my operative function

Definition at line 253 of file SundanceDeriv.hpp.

References symbFunc_.

Return a pointer to my operative function

Definition at line 250 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:
verboseIf 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 138 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 ( int  d) [related]

Definition at line 328 of file SundanceDeriv.cpp.

Referenced by Sundance::CoordDeriv::lessThan().

Deriv coordDeriv ( const MultiIndex mi) [related]

Definition at line 333 of file SundanceDeriv.cpp.

Deriv funcDeriv ( const SymbolicFuncElement symbFunc) [related]

Definition at line 339 of file SundanceDeriv.cpp.

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

Definition at line 344 of file SundanceDeriv.cpp.

Deriv funcDeriv ( const SymbolicFunc symbFunc) [related]

Definition at line 350 of file SundanceDeriv.cpp.

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

Definition at line 356 of file SundanceDeriv.cpp.

Deriv normalDeriv ( const SymbolicFuncElement symbFunc) [related]

Definition at line 363 of file SundanceDeriv.cpp.


Member Data Documentation

Definition at line 276 of file SundanceDeriv.hpp.

Referenced by coordDerivDir().

Definition at line 268 of file SundanceDeriv.hpp.

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

Definition at line 266 of file SundanceDeriv.hpp.

Referenced by algSpec(), and Deriv().

Definition at line 274 of file SundanceDeriv.hpp.

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

Definition at line 272 of file SundanceDeriv.hpp.

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

Site Contact