Computes a residue and its derivative on an element. More...
#include <ElementalOperation.h>
Public Member Functions | |
DResidue (const Element &element, const SimpleMaterial &material, const std::vector< size_t > &fieldsUsed) | |
DResidue (const DResidue &NewEl) | |
virtual DResidue * | clone () const =0 |
virtual bool | getDVal (const MatDouble &argval, MatDouble &funcval, FourDVecDouble &dfuncval) const =0 |
Returns the value of the residue and its derivative given the values of the fields. | |
Static Public Member Functions | |
static bool | consistencyTest (const DResidue &DRes, const std::vector< size_t > &DofPerField, const MatDouble &argval) |
Consistency test for DResidues. | |
static bool | assemble (std::vector< DResidue * > &DResArray, const LocalToGlobalMap &L2G, const VecDouble &Dofs, VecDouble &ResVec, MatDouble &DResMat) |
assemble Residual Vector and it Derivative |
Computes a residue and its derivative on an element.
See Residue class for an explanation.
This class just adds a function getDVal that contains a vector to return the derivative
DResidue::DResidue | ( | const Element & | element, | |
const SimpleMaterial & | material, | |||
const std::vector< size_t > & | fieldsUsed | |||
) | [inline] |
DResidue::DResidue | ( | const DResidue & | NewEl | ) | [inline] |
bool DResidue::assemble | ( | std::vector< DResidue * > & | DResArray, | |
const LocalToGlobalMap & | L2G, | |||
const VecDouble & | Dofs, | |||
VecDouble & | ResVec, | |||
MatDouble & | DResMat | |||
) | [static] |
assemble Residual Vector and it Derivative
Assembles the contributions from an Array of dresidual objects DResArray into DResVec. The contribution from each DResArray, DResArray[e], is mapped into DResVec with a LocalToGlobalMap.
DResArray | Array of dresidue objects | |
L2G | LocalToGlobalMap | |
Dofs | PetscVector with values of degrees of freedom | |
ResVec | Pointer to a PetscVector where to assemble the dresidues. ResVec is zeroed in assemble | |
DResMat | Pointer to a PetscVector where to assemble the dresidues. DResMat is zeroed in assemble |
This is precisely what's done:
1) assemble input gathered as
argval[f][a] = Dofs[L2G(f,a)]
2) Computation of the local residue funcval and its derivative dfucnval as DResArray[i]->getVal(argval, funcval, dfuncval)
3) assemble output gathered as
ResVec[L2G(f,a)] += funcval[f][a]
DResMat[L2G(f,a)][L2G(g,b)] += dfuncval[f][a][g][b]
Behavior:
Successful assembly returns true, unsuccessful false
There must be a flaw in the abstraction.
virtual DResidue* DResidue::clone | ( | ) | const [pure virtual] |
Implements Residue.
Implemented in StressWork.
bool DResidue::consistencyTest | ( | const DResidue & | DRes, | |
const std::vector< size_t > & | DofPerField, | |||
const MatDouble & | argval | |||
) | [static] |
Consistency test for DResidues.
virtual bool DResidue::getDVal | ( | const MatDouble & | argval, | |
MatDouble & | funcval, | |||
FourDVecDouble & | dfuncval | |||
) | const [pure virtual] |
Returns the value of the residue and its derivative given the values of the fields.
argval | vector of vector<double> containing the values of the degrees of freedom for each field. argval[f][a] contains the value of degree of freedom "a" for participating field "f". | |
funcval | It returns a vector< vector<double> > with the values of each component of the residual function. We have that ![]() | |
dfuncval | It returns a vector< vector< vector< vector<double> > > > with the values of each component of the derivative of the residual function. We have that ![]() |
The function returns true if successful, false otherwise.
Implemented in StressWork.