Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FEDD::AssembleFE< SC, LO, GO, NO > Class Template Referenceabstract

This abstract class defining the interface for any type of element assembly rountines in the FEDDLib. More...

#include <AssembleFE_decl.hpp>

Public Types

typedef SmallMatrix< SC > SmallMatrix_Type
 
typedef Teuchos::RCP< SmallMatrix_TypeSmallMatrixPtr_Type
 
typedef AssembleFE< SC, LO, GO, NO > AssembleFE_Type
 

Public Member Functions

virtual void assembleJacobian ()=0
 Compute everything.
 
virtual void assembleJacobianBlock (LO i)=0
 Assemble the element Jacobian matrix.
 
virtual void assembleRHS ()=0
 Assemble the element right hand side vector.
 
SmallMatrixPtr_Type getJacobian ()
 Get the currently assembled element Jacobian matrix.
 
SmallMatrixPtr_Type getJacobianBlock (LO i)
 Get the currently assembled element Jacobian matrix.
 
vec_dbl_ptr_Type getRHS ()
 Get the currently assembled right hand side vector.
 
virtual void checkParameters ()
 Check the input parameters from the constructor and the ParameterList for completeness and consistency.
 
virtual void updateParams (ParameterListPtr_Type params)
 Set or update the parameters read from the ParameterList.
 
virtual void updateParameter (std::string type, double value)
 Update the parameter read from the ParameterList.
 
virtual void advanceInTime (double dt)
 This function is called every time the FEDDLib proceeds from one to the next time step. The size of the time step will always be provided as input.
 
double getTimeStep ()
 Get the time state of the object.
 
void advanceNewtonStep ()
 This function is called every time the FEDDLib proceeds from one to the next newton step. The size of the time step will always be provided as input.
 
int getNewtonStep ()
 Get the time state of the object.
 
void updateSolution (vec_dbl_Type solution)
 Update the solution vector.
 
vec_dbl_ptr_Type getSolution ()
 Get the current local solution vector.
 
void preProcessing ()
 This function is called in the beginning of each Newton step before actually assmblying anything.
 
void postProcessing ()
 This function is called at the end of each Newton step after updating the solution vector.
 
int getDim ()
 Get the spatial dimension. (Typically 2 or 3)
 
vec2D_dbl_Type getNodesRefConfig ()
 Return the coordnates of the finite element nodes.
 
void addRHSFunc (RhsFunc_Type rhsFunc)
 
tuple_sd_vec_ptr_Type getTupleElement ()
 Return vector of tupled with element based values. First column per tuple string with description, second column with corresponding value.
 
double getTimeIncrement ()
 Returns the time increment. Required by AceGen implementation.
 
void setGlobalElementID (GO goID)
 
GO getGlobalElementID ()
 
virtual void computeLocalconstOutputField ()
 E.g. In case of non-newtonian fluids the viscosity is not constant - Compute the viscosity for an element depending on the known velocity solution.
 
vec_dbl_Type getLocalconstOutputField ()
 Obtain value of resulting postprocessing field at nodes/ inside an element.
 

Protected Member Functions

 AssembleFE (int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type parameters, tuple_disk_vec_ptr_Type tuple)
 Constructor.
 

Protected Attributes

SmallMatrixPtr_Type jacobian_
 
SmallMatrixPtr_Type jacobianBlock_
 
vec_dbl_ptr_Type rhsVec_
 
RhsFunc_Type rhsFunc_
 
int dim_
 
tuple_disk_vec_ptr_Type diskTuple_
 
tuple_sd_vec_ptr_Type elementIntormation_
 
vec2D_dbl_Type nodesRefConfig_
 
bool timeProblem_
 
int flag_
 
double timeStep_
 
int newtonStep_
 
ParameterListPtr_Type paramsMaterial_
 
ParameterListPtr_Type params_
 
vec_dbl_ptr_Type solution_
 
double timeIncrement_
 
GO globalElementID_
 
vec_dbl_Type constOutputField_
 

Friends

class AssembleFEFactory< SC, LO, GO, NO >
 

Detailed Description

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
class FEDD::AssembleFE< SC, LO, GO, NO >

This abstract class defining the interface for any type of element assembly rountines in the FEDDLib.

Template Parameters
SCThe scalar type. So far, this is always double, but having it as a template parameter would allow flexibily, e.g., for using complex instead
LOThe local ordinal type. The is the index type for local indices
GOThe global ordinal type. The is the index type for global indices
Todo
This should actually be removed since the class should operate only on element level)
Template Parameters
NOThe Kokkos Node type. This would allow for performance portibility when using Kokkos. Currently, this is not used.

Any new assembly routine on element level should implemented following the interface provided in this class. During the setup of a specific boundary value problem one AssembleFE object will be constructed using the AssembleFEFactory for each finite element. This is can be understood roughly as follows:

for (int i=1; i<numElements; i++) {
AssembleFE assmeblyFe[i] = AssembleFEFactory<>::build("problemType",flag,nodesRefConfig,params,tuple);
}
AssembleFEPtr_Type build(std::string problemType, int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type params, tuple_disk_vec_ptr_Type tuple)
We only need this one function to build assembleFE, where we define the problem type and the Assemble...
Definition AssembleFEFactory_def.hpp:16
AssembleFE(int flag, vec2D_dbl_Type nodesRefConfig, ParameterListPtr_Type parameters, tuple_disk_vec_ptr_Type tuple)
Constructor.
Definition AssembleFE_def.hpp:10

It is not possible to construct an AssembleFE object without using the AssembleFEFactory since the constructor is protected and hence not directly accessible.

Similar to constructing the AssembleFE, all other member functions will be called automatically by the FEDDLib during the program flow. For instance, the assembly of the element Jacobian matrices will be performed:

for (int i=1; i<numElements; i++) {
assmeblyFe[i].assembleJacobian();
Matrix_Type elementJacobian[i] = assmeblyFe[i].getJacobian();
}

A specific implementation of a class derived from AssembleFE can only interact with the FEDDLib by implementing the public member functions in AssembleFE for

  • Construction
  • Assmebly of the Jacobian and right hand side
  • Getting the Jacobian and right hand side
  • Upating the solution
  • ...

They will be automatically executed as the construction and assembly of the Jacobian; see above.

If additional public member functions are added, they will not be executed from the FEDDLib. Therefore, we only allow for adding additional protected or private functions.

Upon construction, the FEDDLib will provide some information, such as

  • The element flag
  • The coordinates of the finite element nodes
  • ...

Additional parameters, such as material parameters, can provided through a Teuchos::ParameterList object which will contain all the parameters specified in the input file ABC.xml. The structure of the input file and, hence, of the resulting parameter list can be chosen freely depending on the specific implementation of an element assembly. The FEDDLib will take care of reading the parameters from the file and making them available to every AssembleFE object.

Constructor & Destructor Documentation

◆ AssembleFE()

template<class SC, class LO, class GO, class NO>
FEDD::AssembleFE< SC, LO, GO, NO >::AssembleFE ( int flag,
vec2D_dbl_Type nodesRefConfig,
ParameterListPtr_Type parameters,
tuple_disk_vec_ptr_Type tuple )
protected

Constructor.

Parameters
[in]flagFlag of element
[in]nodesRefConfigNodes of element in reference configuration
[in]paramsParameterlist for current problem
[in]tuplevector of element information tuples.

Element Numbering for triangular elements:

- Triangle numbering

                2
                *
                *
          4     5
                *
                *
    1 * * 3 * * 0

- Tetrahedral numbering

            Face 1          Face2               Face 3          Face 4
                2      2 * * 9 * * 3        3 * * 9 * * 2               3
                *      *          *          *          *             * *
                *      *        *             *        *            *   *
          5     6      6      7                8      5           8     7
                *      *    *                   *    *          *       *
                *      *  *                      *  *         *         *
    1 * * 4 * * 0       0                         1         1 * * 4 * * 0

Here is the call graph for this function:

Member Function Documentation

◆ addRHSFunc()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
void FEDD::AssembleFE< SC, LO, GO, NO >::addRHSFunc ( RhsFunc_Type rhsFunc)
inline
Todo
Still work in Progress with RHS and Mass Matrix

◆ advanceInTime()

template<class SC, class LO, class GO, class NO>
void FEDD::AssembleFE< SC, LO, GO, NO >::advanceInTime ( double dt)
virtual

This function is called every time the FEDDLib proceeds from one to the next time step. The size of the time step will always be provided as input.

Parameters
[in]dtTimestepping length

Reimplemented in FEDD::AssembleFE_SCI_NH< SC, LO, GO, NO >, FEDD::AssembleFE_SCI_SMC_Active_Growth_Reorientation< SC, LO, GO, NO >, FEDD::AssembleFE_SCI_SMC_Active_Growth_Reorientation< SC, LO, GO, NO >, FEDD::AssembleFE_SCI_SMC_Active_Growth_Reorientation< SC, LO, GO, NO >, and FEDD::AssembleFE_SCI_SMC_MLCK< SC, LO, GO, NO >.

◆ assembleJacobian()

◆ assembleJacobianBlock()

◆ assembleRHS()

◆ computeLocalconstOutputField()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
virtual void FEDD::AssembleFE< SC, LO, GO, NO >::computeLocalconstOutputField ( )
inlinevirtual

E.g. In case of non-newtonian fluids the viscosity is not constant - Compute the viscosity for an element depending on the known velocity solution.

Reimplemented in FEDD::AssembleFEGeneralizedNewtonian< SC, LO, GO, NO >, FEDD::AssembleFEGeneralizedNewtonian< SC, LO, GO, NO >, and FEDD::AssembleFEGeneralizedNewtonian< SC, LO, GO, NO >.

◆ getDim()

template<class SC, class LO, class GO, class NO>
int FEDD::AssembleFE< SC, LO, GO, NO >::getDim ( )

Get the spatial dimension. (Typically 2 or 3)

Todo
PostProcessing: Teuchos::Array with values and one global Array with Strings and names
Returns
dimension.

◆ getJacobian()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
SmallMatrixPtr_Type FEDD::AssembleFE< SC, LO, GO, NO >::getJacobian ( )
inline

Get the currently assembled element Jacobian matrix.

Returns
the element Jacobian matrix

◆ getJacobianBlock()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
SmallMatrixPtr_Type FEDD::AssembleFE< SC, LO, GO, NO >::getJacobianBlock ( LO i)
inline

Get the currently assembled element Jacobian matrix.

Returns
the element Jacobian matrix

◆ getLocalconstOutputField()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
vec_dbl_Type FEDD::AssembleFE< SC, LO, GO, NO >::getLocalconstOutputField ( )
inline

Obtain value of resulting postprocessing field at nodes/ inside an element.

/*!

Returns
values

◆ getNewtonStep()

template<class SC, class LO, class GO, class NO>
int FEDD::AssembleFE< SC, LO, GO, NO >::getNewtonStep ( )

Get the time state of the object.

Returns
newtonStep.

◆ getNodesRefConfig()

template<class SC, class LO, class GO, class NO>
vec2D_dbl_Type FEDD::AssembleFE< SC, LO, GO, NO >::getNodesRefConfig ( )

Return the coordnates of the finite element nodes.

Returns
a 2D array with the coordnates for each nodes
Todo
How is the ordering?

◆ getRHS()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
vec_dbl_ptr_Type FEDD::AssembleFE< SC, LO, GO, NO >::getRHS ( )
inline

Get the currently assembled right hand side vector.

Returns
the element right hand side vector

◆ getSolution()

template<class SC, class LO, class GO, class NO>
vec_dbl_ptr_Type FEDD::AssembleFE< SC, LO, GO, NO >::getSolution ( )

Get the current local solution vector.

Returns
the solution vector.

◆ getTimeIncrement()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
double FEDD::AssembleFE< SC, LO, GO, NO >::getTimeIncrement ( )
inline

Returns the time increment. Required by AceGen implementation.

Returns
timeIncrement

◆ getTimeStep()

template<class SC, class LO, class GO, class NO>
double FEDD::AssembleFE< SC, LO, GO, NO >::getTimeStep ( )

Get the time state of the object.

Returns
the timestep

◆ getTupleElement()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
tuple_sd_vec_ptr_Type FEDD::AssembleFE< SC, LO, GO, NO >::getTupleElement ( )
inline

Return vector of tupled with element based values. First column per tuple string with description, second column with corresponding value.

Returns
elementInformation

◆ updateParameter()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
virtual void FEDD::AssembleFE< SC, LO, GO, NO >::updateParameter ( std::string type,
double value )
inlinevirtual

Update the parameter read from the ParameterList.

Parameters
[in]Parameteras read from the xml file

Reimplemented in FEDD::AssembleFE_NonLinElas2< SC, LO, GO, NO >, and FEDD::AssembleFE_NonLinElas< SC, LO, GO, NO >.

◆ updateParams()

template<class SC, class LO, class GO, class NO>
void FEDD::AssembleFE< SC, LO, GO, NO >::updateParams ( ParameterListPtr_Type params)
virtual

Set or update the parameters read from the ParameterList.

Parameters
[in]ParameterListas read from the xml file

◆ updateSolution()

template<class SC, class LO, class GO, class NO>
void FEDD::AssembleFE< SC, LO, GO, NO >::updateSolution ( vec_dbl_Type solution)

Update the solution vector.

Todo
We still have to fix the ordering of the dofs.
Parameters
[in]solution

Member Data Documentation

◆ nodesRefConfig_

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
vec2D_dbl_Type FEDD::AssembleFE< SC, LO, GO, NO >::nodesRefConfig_
protected
Todo
Why "Reference Configuration"?

The documentation for this class was generated from the following files: