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 ![]() dofID ![]() | |
const FunctionIdentifier & | fid () const |
const SpatialDerivSpecifier & | opOnFunc () const |
const AlgebraSpecifier & | algSpec () const |
const AlgebraSpecifier & | funcAlgSpec () const |
RCP< const CommonFuncDataStub > | data () const |
int | coordDerivDir () const |
const SymbolicFuncElement * | symbFuncElem () const |
const SymbolicFunc * | symbFunc () const |
Private Member Functions | |
const SymbolicFuncDescriptor * | sfdPtr () 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 SymbolicFuncElement * | symbFuncElem_ |
const SymbolicFunc * | symbFunc_ |
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) |
The bridge theorem involves expressions of the form
and
where is some spatial differential operator acting on the function
, and
is a basis function with which
is represented. A derivative such as
will be called a functional derivative to distinguish it from derivatives with respect to spatial coordinates, such as
. The following table shows the types of derivative currently supported.
Operation | Geometry of derivative value | Operating function geometry | Operating spatial operator | Operating function subtype |
![]() | Scalar | Coordinate component | N/A | N/A |
![]() | Scalar | Scalar (![]() | Identity | SymbolicFuncElement |
![]() | Coordinate component | Scalar (![]() | Partial derivative ![]() | SymbolicFuncElement |
![]() | Normal component | Scalar (![]() | Normal derivative ![]() | SymbolicFuncElement |
![]() | Scalar | Vector (![]() | Divergence | SymbolicFunc |
![]() | Coordinate component | Vector (![]() ![]() ![]() | Inner product with coordinate unit vector | SymbolicFuncElement |
![]() | Normal component | Vector (![]() ![]() | Inner product with normal unit vector | SymbolicFunc |
![]() | Coordinate component | Vector (![]() | Inner product with normal unit vector | SymbolicFuncElement |
Definition at line 143 of file SundanceDeriv.hpp.
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., .
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:
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 | |||
) |
Construct a deriv wrt a function
Definition at line 79 of file SundanceDeriv.cpp.
References Sundance::FunctionIdentifier::algSpec(), checkConsistencyOfOperations(), derivAlgSpec(), Sundance::FunctionWithID::fid(), fid_, and myAlgSpec_.
const AlgebraSpecifier& Sundance::Deriv::algSpec | ( | ) | const [inline] |
bool Deriv::canBeDifferentiated | ( | ) | const |
Whether it's possible to take a spatial derivative of this object
Definition at line 222 of file SundanceDeriv.cpp.
References Sundance::EnumTypeField< DerivType >::assertType(), Sundance::FunctionalDT, Sundance::SpatialDerivSpecifier::isIdentity(), isParameter(), Sundance::SpatialDerivSpecifier::isPartial(), and opOnFunc().
void Deriv::checkConsistencyOfOperations | ( | ) | const [private] |
Definition at line 96 of file SundanceDeriv.cpp.
References fid_, Sundance::SpatialDerivSpecifier::isDivergence(), Sundance::SpatialDerivSpecifier::isNormal(), Sundance::SpatialDerivSpecifier::isPartial(), Sundance::FunctionIdentifier::isVector(), and sds_.
Referenced by Deriv().
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 |
Return a pointer to my function's data
Definition at line 235 of file SundanceDeriv.cpp.
References Sundance::EnumTypeField< DerivType >::assertType(), Sundance::SymbolicFunc::commonData(), Sundance::SymbolicFuncElement::commonData(), Sundance::FunctionalDT, symbFunc_, and symbFuncElem_.
AlgebraSpecifier Deriv::derivAlgSpec | ( | const AlgebraSpecifier & | a, | |
const SpatialDerivSpecifier & | sds | |||
) | [static, private] |
Definition at line 284 of file SundanceDeriv.cpp.
References Sundance::SpatialDerivSpecifier::derivOrder(), Sundance::MultiIndex::firstOrderDirection(), Sundance::IdentitySDT, Sundance::SpatialDerivSpecifier::isDivergence(), Sundance::SpatialDerivSpecifier::isNormal(), Sundance::SpatialDerivSpecifier::isPartial(), Sundance::SpatialDerivSpecifier::mi(), Sundance::NormalAT, and Sundance::ScalarAT.
Referenced by Deriv().
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 to
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 then return
dofID
. 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 |
Return the ID for my operative function
Definition at line 247 of file SundanceDeriv.cpp.
References Sundance::EnumTypeField< DerivType >::assertType(), fid_, and Sundance::FunctionalDT.
Referenced by Sundance::DiffOpEvaluator::backedDerivs(), Sundance::GrouperBase::extractWeakForm(), and operator<().
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] |
True if this is a derivative wrt a function or a spatial derivative of a function
Definition at line 190 of file SundanceDeriv.hpp.
References Sundance::FunctionalDT, and Sundance::EnumTypeField< DerivType >::type().
Referenced by Sundance::EquationSet::addToVarUnkPairs(), Sundance::applyTx(), Sundance::GrouperBase::extractWeakForm(), isParameter(), isTestFunction(), isUnknownFunction(), and Sundance::CoordDeriv::lessThan().
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 |
Return the spatial derivative acting on my operative function
Definition at line 253 of file SundanceDeriv.cpp.
References Sundance::EnumTypeField< DerivType >::assertType(), Sundance::FunctionalDT, and sds_.
Referenced by Sundance::applyTx(), Sundance::DiffOpEvaluator::backedDerivs(), canBeDifferentiated(), Sundance::DiffOpEvaluator::DiffOpEvaluator(), Sundance::GrouperBase::extractWeakForm(), and toString().
const SymbolicFuncDescriptor * Deriv::sfdPtr | ( | ) | const [private] |
Definition at line 168 of file SundanceDeriv.cpp.
References Sundance::EnumTypeField< DerivType >::assertType(), Sundance::FunctionalDT, symbFunc_, and symbFuncElem_.
Referenced by isParameter(), isTestFunction(), and isUnknownFunction().
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
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().
Deriv coordDeriv | ( | const MultiIndex & | mi | ) | [related] |
Definition at line 322 of file SundanceDeriv.cpp.
Deriv coordDeriv | ( | int | d | ) | [related] |
Definition at line 317 of file SundanceDeriv.cpp.
Referenced by Sundance::DiscreteFuncElement::internalDetermineR(), and Sundance::CoordDeriv::lessThan().
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.
int Sundance::Deriv::coordDerivDir_ [private] |
FunctionIdentifier Sundance::Deriv::fid_ [private] |
Definition at line 257 of file SundanceDeriv.hpp.
Referenced by checkConsistencyOfOperations(), Deriv(), dofID(), fid(), and funcAlgSpec().
AlgebraSpecifier Sundance::Deriv::myAlgSpec_ [private] |
SpatialDerivSpecifier Sundance::Deriv::sds_ [private] |
Definition at line 259 of file SundanceDeriv.hpp.
Referenced by checkConsistencyOfOperations(), derivWrtMultiIndex(), operator<(), and opOnFunc().
const SymbolicFunc* Sundance::Deriv::symbFunc_ [private] |
Definition at line 263 of file SundanceDeriv.hpp.
Referenced by data(), derivWrtMultiIndex(), sfdPtr(), symbFunc(), and toString().
const SymbolicFuncElement* Sundance::Deriv::symbFuncElem_ [private] |
Definition at line 261 of file SundanceDeriv.hpp.
Referenced by data(), derivWrtMultiIndex(), sfdPtr(), symbFuncElem(), and toString().