DResidue Class Reference

Computes a residue and its derivative on an element. More...

#include <ElementalOperation.h>

Inheritance diagram for DResidue:
BaseResidue Residue StressWork

List of all members.

Public Member Functions

 DResidue (const Element &element, const SimpleMaterial &material, const std::vector< size_t > &fieldsUsed)
 DResidue (const DResidue &NewEl)
virtual DResidueclone () 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

Detailed Description

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


Constructor & Destructor Documentation

DResidue::DResidue ( const Element element,
const SimpleMaterial material,
const std::vector< size_t > &  fieldsUsed 
) [inline]
DResidue::DResidue ( const DResidue NewEl  )  [inline]

Member Function Documentation

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.

Parameters:
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

Warning:
: The residue object that computes the contributions of element "e" is required to have position "e" in DResArray as well, so that the LocalToGlobalMap object is used consistently
Todo:
This structure has to be revised. In the implementation of both assemble functions I had to use a dynamic_cast to prevent writing two versions of essentially the same code, one for residue and another for

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.

Parameters:
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 $F^f_a$=funcval[f][a]. The vector funcval is resized and zeroed in getVal.
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 $\frac{\partial F^f_a}{\partial u^g_b}$=dfuncval[f][a][g][b]. The vector dfuncval is resized and zeroed in getVal.

The function returns true if successful, false otherwise.

Implemented in StressWork.


The documentation for this class was generated from the following files:
Generated on Tue Aug 2 11:51:27 2011 for Galois by  doxygen 1.6.3