AVI Class Reference

AVI.h DG++. More...

#include <AVI.h>

Inheritance diagram for AVI:
StandardAVI

List of all members.

Public Member Functions

 AVI ()
virtual ~AVI ()
 AVI (const AVI &NewAVI)
virtual AVIclone () const =0
virtual double getTimeStep () const =0
 Returns the current value of the time step for the potential.
virtual double getTimeStamp () const =0
 Returns the last time at which the force field was updated.
virtual bool setTimeStamp (double timeval)=0
 set the last update time.
virtual double getNextTimeStamp () const =0
 Returns the next time at which the force field will be updated.
virtual void incTimeStamp ()=0
 increment the time stamp
virtual const std::vector
< size_t > & 
getFields () const =0
 Returns the field numbers used whose degrees of freedom participate in the force field computation.
virtual size_t getFieldDof (size_t fieldnumber) const =0
 Returns the number of degrees of freedom per field used for the computation
.
virtual size_t getGlobalIndex (void) const =0
 Returns the global element index for the AVI object.
virtual const DResiduegetOperation () const =0
virtual const ElementgetElement () const =0
virtual const ElementGeometrygetGeometry () const =0
virtual void computeLocalTvec (MatDouble &tnew) const =0
 write the updated time vector into the argument provided value filled in is the one obtained from getNextTimeStamp ()
virtual bool vbInit (const MatDouble &q, const MatDouble &v, const MatDouble &vb, const MatDouble &ti, const MatDouble &tnew, MatDouble &qnew, MatDouble &vbinit, MatDouble &forcefield, MatDouble &funcval, MatDouble &deltaV) const =0
 Initialization routine to set values at the half time step This function is called only once per element and is called after gather and before update and assemble.
virtual bool getForceField (const MatDouble &argval, MatDouble &forcefield) const =0
 Computes the value of the force field at a given configuration.
virtual bool update (const MatDouble &q, const MatDouble &v, const MatDouble &vb, const MatDouble &ti, const MatDouble &tnew, MatDouble &qnew, MatDouble &vnew, MatDouble &vbnew, MatDouble &forcefield, MatDouble &funcval, MatDouble &deltaV) const =0
 update of the given forcefield.
virtual bool gather (const LocalToGlobalMap &L2G, const VecDouble &Qval, const VecDouble &Vval, const VecDouble &Vbval, const VecDouble &Tval, MatDouble &q, MatDouble &v, MatDouble &vb, MatDouble &ti) const =0
 Gathers the values needed from the global arrays to perform the force field computation.
virtual bool assemble (const LocalToGlobalMap &L2G, const MatDouble &qnew, const MatDouble &vnew, const MatDouble &vbnew, const MatDouble &tnew, VecDouble &Qval, VecDouble &Vval, VecDouble &Vbval, VecDouble &Tval, VecDouble &LUpdate) const =0
 Assembles the updated values in the global array, including the latest time of update of the degrees of freedom in the object.
virtual const std::string toString () const

Protected Member Functions

virtual void setTimeStep (double epsilon=1.0)=0
virtual void computeDeltaV (const MatDouble &funcval, MatDouble &DeltaV) const =0
 Solves the system of equations with the mass matrix for $\Delta v_b$.
virtual bool getImposedValues (const GlobalElementIndex &ElementIndex, const LocalToGlobalMap &L2G, size_t field, size_t dof, double &qvalue, double &vvalue) const =0
 Imposed values of the degrees of freedom and its time derivative.

Friends

std::ostream & operator<< (std::ostream &out, const AVI &avi)

Detailed Description

AVI.h DG++.

Created by Adrian Lew on 9/23/08.

Copyright (c) 2008 Adrian Lew

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AVI: abstract base class for AVI An AVI object consists of:

1) A force field $f_a(q_1,\ldots,q_N,t)$, where $q_a$ are degrees of freedom, and $f_a$ is the force acting on degree of freedom "a".
2) A mass matrix for the degrees of freedom of the potential.
3) A time step
4) The last time at which the force field was updated
5) The last time each degree of freedom was updated

The AVI class assumes that there exists four provided global arrays, accessed through a LocalToGlobalMap:

1) An array Qval with the value of each degree of freedom at its last update, $q_a^{i-1}$
2) An array Vval with the latest value of the time derivative of the degrees of freedom at its last update, $v_a^{i-1}$.
3) An array Vbval with the latest value of the time derivative of the degree of freedom at the middle of a time step, $v_a^{i-1/2}$.
4) An array Tval with the last time at which a degree of freedom was updated, $t_a^{i-1}$.

Given $q_a^{i-1}$, $v_a^{i-1/2}$ and $t_a^{i-1}$, the class computes $q_a^i$, $v_a^i$ and $v_a^{i+1/2}$ for each degree of freedom of the object's force field. It also updates the values of $t_a^i$ and the objects latest time.

The update is as follows:

If $q_a$ does not have imposed values $q_a(t)$ (e.g., Dirichlet bounday conditions), then

1) Compute $q_a^i = q_a^{i-1} + (t-t_a^i) v_a^{i-1/2}$ for each $a$, where $t$ is the current time of the object.
2) Solve $ M_{ab} \Delta v_b = - \Delta t f_a(q_a^i)$ for $\Delta v_b$, where $f_a(t)$ is the force on node $a$ by the force field in the object computed with $q_a^i$.
3) Compute $ v_a^i = v_a^{i-1/2} + \Delta v_b/2$
4) Compute $ v_a^{i+1/2} = v_a^{i-1/2} + \Delta v_b$

Else, set $q_a^i=q_a(t_a^i)$, $v_a^i=\dot{q}_a(t_a^i)$ and $v_a^{i+1/2}$ is defined to any value, it is not guaranteed to have any meaning.

The class also has an initialization procedure to compute the initial values of $v_a^{1/2}$.

Following the convention elsewhere in the code, degrees of freedom are labeled with field number f and degree of freedom number for that field, b. Even thought it is not the most natural numbering in the context of ODEs, it simplifies the communication with the rest of the code. Field and degree of freedom numbers begin from zero.

The class separates the update process into three different functions: gather, update, assemble. In this way more flexibility is provided to be able to work with force fields that depend, perhaps, on sets of internal variables that are not necessarily updated with AVI.

Imposed values need to be provided separately. A virtual procedure is constructed to this end.

Todo:
The update routine does not take further arguments that may not need to be updated but may be needed to compute the force field, such as when dealing with plasticity or a coupled heat conduction problem. We will need to deal with this eventually.

Constructor & Destructor Documentation

AVI::AVI (  )  [inline]
virtual AVI::~AVI (  )  [inline, virtual]
AVI::AVI ( const AVI NewAVI  )  [inline]

Member Function Documentation

virtual bool AVI::assemble ( const LocalToGlobalMap L2G,
const MatDouble qnew,
const MatDouble vnew,
const MatDouble vbnew,
const MatDouble tnew,
VecDouble Qval,
VecDouble Vval,
VecDouble Vbval,
VecDouble Tval,
VecDouble LUpdate 
) const [pure virtual]

Assembles the updated values in the global array, including the latest time of update of the degrees of freedom in the object.

identify its global degrees of freedom. This information is not embedded in the object.

Parameters:
L2G Local to Global map used to find the values in the Global arrays
qnew local vector with the updated values of the degrees of freedom, $q_a^{i}$ in the notation above.
vnew Upon exit, local vector with the updated values of the time derivatives of the degrees of freedom, $v_a^{i}$ in the notation above.
vbnew Upon exit, local vector with the updated values of the time derivatives at the middle of a time step of the degrees of freedom, $v_a^{i+1/2}$ in the notation above.
tnew updated values of time vector
Qval Global array where to assemble the updated values of the degrees of freedom.
Vval Global array where to assemble the time derivatives of the degrees of freedom.
Vbval Global array where to assemble the time derivatives of the degrees of freedom at the middle of the time step.
Tval Global array where to assemble the times at which the degrees of freedom were last updated.
LUpdate Global array to keep track of which element updated the Dof last. This is used to keep Dofs from being updated out of order due to messaging delays. contains the global elem index of the last element to update each Dof.

For example, Q[L2G.map(ElementIndex,getFields()[f],b)]=q[f][b]

Implemented in StandardAVI.

virtual AVI* AVI::clone (  )  const [pure virtual]

Implemented in StandardAVI.

virtual void AVI::computeDeltaV ( const MatDouble funcval,
MatDouble DeltaV 
) const [protected, pure virtual]

Solves the system of equations with the mass matrix for $\Delta v_b$.


This is made a virtual function so that, if the mass matrix happens to be diagonal, it is done efficiently.

Parameters:
funcval values of $\Delta t f_a(q_a^i)$. Notice that the multiplication by $\Delta t$ is already included. funcval[f][b] contains the value of $\Delta t f_a(q_a^i)$ for the degree of freedom indexed with field "f" and degree of freedom number in that field "b".
DeltaV values of $\Delta v_a$ upon exit. DeltaV[f][b] contains the value of $\Delta v_a$ for the degree of freedom indexed with field "f" and degree of freedom number in that field "b".

Implemented in StandardAVI.

virtual void AVI::computeLocalTvec ( MatDouble tnew  )  const [pure virtual]

write the updated time vector into the argument provided value filled in is the one obtained from getNextTimeStamp ()

Parameters:
tnew 

Implemented in StandardAVI.

virtual bool AVI::gather ( const LocalToGlobalMap L2G,
const VecDouble Qval,
const VecDouble Vval,
const VecDouble Vbval,
const VecDouble Tval,
MatDouble q,
MatDouble v,
MatDouble vb,
MatDouble ti 
) const [pure virtual]

Gathers the values needed from the global arrays to perform the force field computation.

identify its global degrees of freedom. This information is not embedded in the object.

Parameters:
L2G Local to Global map used to find the values in the Global arrays
Qval Global array with the last updated values of the degrees of freedom.
Vval Global array with the last updated values of the time derivatives of the degrees of freedom.
Vbval Global array with the last updated values of the time derivatives of the degrees of freedom at the middle of the time step.
Tval Global array with the times at which the degrees of freedom were last updated.
q Upon exit, local vector with the last known values of the degrees of freedom, $q_a^{i-1}$ in the notation above.
v Upon exit, local vector with the last known values of the time derivatives of the degrees of freedom, $v_a^{i-1}$ in the notation above.
vb Upon exit, local vector with the last known values of the time derivatives at the middle of a time step of the degrees of freedom, $v_a^{i-1/2}$ in the notation above.
ti Upon exit, local vector with the last update time of a the degrees of freedom, $t_a^{i-1}$ in the notation above.

For example, q[f][b] = Q[L2G.map(ElementIndex,getFields()[f],b)]

This function uses getImposedValues to fill the imposed values arrays.

Implemented in StandardAVI.

virtual const Element& AVI::getElement (  )  const [pure virtual]

Implemented in StandardAVI.

virtual size_t AVI::getFieldDof ( size_t  fieldnumber  )  const [pure virtual]

Returns the number of degrees of freedom per field used for the computation
.

getFieldDof(fieldnum) returns the number of deegrees of freedom in the participating field number "fieldnumber". The argument fieldnumber begins from zero.

Implemented in StandardAVI.

virtual const std::vector<size_t>& AVI::getFields (  )  const [pure virtual]

Returns the field numbers used whose degrees of freedom participate in the force field computation.

getFields()[i] returns the field number beginning from zero.
If the degree of freedom $q_a$ is indexed with [f][b] locally, then it corresponds to field getFields()[f] in the Global arrays.

Implemented in StandardAVI.

virtual bool AVI::getForceField ( const MatDouble argval,
MatDouble forcefield 
) const [pure virtual]

Computes the value of the force field at a given configuration.

Returns true upon success.

Parameters:
argval values of the degrees of freedom for the force field of the object. argval[f][a] contains the value of the degree of freedom indexed with field "f" and degree of freedom number in that field "a".
forcefield values of $f_b$ upon exit. forcefield[f][a] contains the value of $f_b$ for the degree of freedom indexed with field "f" and degree of freedom number in that field "a".

Implemented in StandardAVI.

virtual const ElementGeometry& AVI::getGeometry (  )  const [pure virtual]

Implemented in StandardAVI.

virtual size_t AVI::getGlobalIndex ( void   )  const [pure virtual]

Returns the global element index for the AVI object.

Implemented in StandardAVI.

virtual bool AVI::getImposedValues ( const GlobalElementIndex ElementIndex,
const LocalToGlobalMap L2G,
size_t  field,
size_t  dof,
double &  qvalue,
double &  vvalue 
) const [protected, pure virtual]

Imposed values of the degrees of freedom and its time derivative.

Parameters:
ElementIndex GlobalElementIndex or index of the force field in the AVI object, used to identify its global degrees of freedom. This information is not embedded in the object.
L2G Local to Global map used to find the values in the Global arrays
field field number for which the imposed values are sought, starting from zero.
dof degree of freedom number within field "field" for which the imposed values are sought, starting from zero.
qvalue upon exit, imposed value of the degree of freedom
vvalue upon exit, imposed value of the time derivative of the degree of freedom

The values of ElementIndex and L2G are not always needed, but they are included here to provide a general interface.

Todo:
There has to be a cleaner way to deal with the value of the boundary condition other than providing a general interface to code them in the derived classes.

Implemented in StandardAVI.

virtual double AVI::getNextTimeStamp (  )  const [pure virtual]

Returns the next time at which the force field will be updated.

Implemented in StandardAVI.

virtual const DResidue& AVI::getOperation (  )  const [pure virtual]

Implemented in StandardAVI.

virtual double AVI::getTimeStamp (  )  const [pure virtual]

Returns the last time at which the force field was updated.

Implemented in StandardAVI.

virtual double AVI::getTimeStep (  )  const [pure virtual]

Returns the current value of the time step for the potential.

Implemented in StandardAVI.

virtual void AVI::incTimeStamp (  )  [pure virtual]

increment the time stamp

Implemented in StandardAVI.

virtual bool AVI::setTimeStamp ( double  timeval  )  [pure virtual]

set the last update time.

Returns true upon success.

Parameters:
timeval value of the last update time

Implemented in StandardAVI.

virtual void AVI::setTimeStep ( double  epsilon = 1.0  )  [protected, pure virtual]

Implemented in StandardAVI.

virtual const std::string AVI::toString (  )  const [inline, virtual]
Returns:
string representation for printing debugging etc
virtual bool AVI::update ( const MatDouble q,
const MatDouble v,
const MatDouble vb,
const MatDouble ti,
const MatDouble tnew,
MatDouble qnew,
MatDouble vnew,
MatDouble vbnew,
MatDouble forcefield,
MatDouble funcval,
MatDouble deltaV 
) const [pure virtual]

update of the given forcefield.

It returns the new values for the degrees of freedom and its time derivatives. These need yet to be assembled. Returns true upon success.

The forcefield time is updated. Of course, this does not happen with the last update time of each degree of freedom, which are updated in the assemble part.

In the following vectors, index [f][b] indicates the value for the "b"-th degree of freedom of field "f".

Parameters:
q vector with the last known values of the degrees of freedom, $q_a^{i-1}$ in the notation above.
v vector with the last known values of the time derivatives of the degrees of freedom, $v_a^{i-1}$ in the notation above.
vb vector with the last known values of the time derivatives at the middle of a time step of the degrees of freedom, $v_a^{i-1/2}$ in the notation above.
ti vector with the last update time of a the degrees of freedom, $t_a^{i-1}$ in the notation above.
tnew vector with the updated time of a the degrees of freedom, $t_a^{i}$ in
qnew Upon exit, new values of the degrees of freedom, $q_a^{i}$ in the notation above.
vnew Upon exit, new values of the time derivatives of the degrees of freedom, $v_a^{i}$ in the notation above.
vbnew Upon exit, new values of the time derivatives at the middle of a time step of the degrees of freedom, $v_a^{i+1/2}$ in the notation above.
forcefield temporary intermediate vector
funcval temporary intermediate vector
deltaV temporary intermediate vector

Implemented in StandardAVI.

virtual bool AVI::vbInit ( const MatDouble q,
const MatDouble v,
const MatDouble vb,
const MatDouble ti,
const MatDouble tnew,
MatDouble qnew,
MatDouble vbinit,
MatDouble forcefield,
MatDouble funcval,
MatDouble deltaV 
) const [pure virtual]

Initialization routine to set values at the half time step This function is called only once per element and is called after gather and before update and assemble.

Parameters:
q used to calculate the velocity at the half step. local vector with the last known values of the degrees of freedom, $q_a^{i-1}$ in the notation above.
v previous values of the time derivatives of velocity
vb previous values of the time derivatives at the middle of a time step of the degrees of freedom, $v_a^{i-1/2}$ in the notation above.
ti local vector with the last update time of a the degrees of freedom, $t_a^{i-1}$ in the notation above.
tnew updated local time vector
See also:
AVI::computeLocalTvec ()
Parameters:
qnew updated value of q vector
vbinit initialized value of vb vector
forcefield temporary intermediate vector
funcval temporary intermediate vector
deltaV temporary intermediate vector For example, q[f][b] = Q[L2G.map(ElementIndex,getFields()[f],b)]

This function uses getImposedValues to fill the imposed values arrays.

Implemented in StandardAVI.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const AVI avi 
) [friend]
Returns:
for use with std::ostream

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