Opm::Elasticity::ElasticityUpscale< GridType, PC > Class Template Reference

The main driver class. More...

#include <elasticity_upscale.hpp>

Public Types

typedef
GridType::LeafGridView::ctype 
ctype
 A basic number. More...
 
typedef Dune::FieldVector
< double, dim
NodeValue
 A vectorial node value. More...
 
typedef
GridType::LeafGridView::template
Codim
< 1 >::Geometry::GlobalCoordinate 
GlobalCoordinate
 A global coordinate. More...
 
typedef
GridType::LeafGridView::IndexSet 
LeafIndexSet
 A set of indices. More...
 
typedef
GridType::LeafGridView::template
Codim< 0 >::Iterator 
LeafIterator
 An iterator over grid cells. More...
 
typedef PC::type PCType
 Our preconditioner type. More...
 
typedef std::shared_ptr
< typename PC::type > 
PCPtr
 A pointer to our preconditioner. More...
 

Public Member Functions

 ElasticityUpscale (const GridType &gv_, ctype tol_, ctype Escale_, const std::string &file, const std::string &rocklist, bool verbose_)
 Main constructor. More...
 
void findBoundaries (double *min, double *max)
 Find boundary coordinates. More...
 
void addMPC (Direction dir, int slave, const BoundaryGrid::Vertex &m)
 Add a MPC equation. More...
 
void periodicBCs (const double *min, const double *max)
 Establish periodic boundaries using the MPC approach. More...
 
void periodicBCsMortar (const double *min, const double *max, int n1, int n2, int p1, int p2)
 Establish periodic boundaries using the mortar approach. More...
 
void fixCorners (const double *min, const double *max)
 Fix corner nodes. More...
 
void assemble (int loadcase, bool matrix)
 Assemble (optionally) stiffness matrix A and load vector. More...
 
template<int comp>
void averageStress (Dune::FieldVector< ctype, comp > &sigma, const Vector &u, int loadcase)
 Calculate the average stress vector for the given loadcase. More...
 
void solve (int loadcase)
 Solve Au = b for u. More...
 
void setupSolvers (const LinSolParams &params)
 

Public Attributes

ASMHandler< GridType > A
 The linear operator. More...
 
Vector u [6]
 The solution vectors. More...
 
Vector b [6]
 The load vectors. More...
 
std::vector< double > volumeFractions
 Vector holding the volume fractions for materials (grouped by SATNUM) More...
 
bool bySat
 Are volume fractions grouped by SATNUM? More...
 
double upscaledRho
 Upscaled density. More...
 

Static Public Attributes

static const int dim = GridType::dimension
 Dimension of our grid. More...
 

Detailed Description

template<class GridType, class PC>
class Opm::Elasticity::ElasticityUpscale< GridType, PC >

The main driver class.

Member Typedef Documentation

template<class GridType , class PC >
typedef GridType::LeafGridView::ctype Opm::Elasticity::ElasticityUpscale< GridType, PC >::ctype

A basic number.

template<class GridType , class PC >
typedef GridType::LeafGridView::template Codim<1>::Geometry::GlobalCoordinate Opm::Elasticity::ElasticityUpscale< GridType, PC >::GlobalCoordinate

A global coordinate.

template<class GridType , class PC >
typedef GridType::LeafGridView::IndexSet Opm::Elasticity::ElasticityUpscale< GridType, PC >::LeafIndexSet

A set of indices.

template<class GridType , class PC >
typedef GridType::LeafGridView::template Codim<0>::Iterator Opm::Elasticity::ElasticityUpscale< GridType, PC >::LeafIterator

An iterator over grid cells.

template<class GridType , class PC >
typedef Dune::FieldVector<double,dim> Opm::Elasticity::ElasticityUpscale< GridType, PC >::NodeValue

A vectorial node value.

template<class GridType , class PC >
typedef std::shared_ptr<typename PC::type> Opm::Elasticity::ElasticityUpscale< GridType, PC >::PCPtr

A pointer to our preconditioner.

template<class GridType , class PC >
typedef PC::type Opm::Elasticity::ElasticityUpscale< GridType, PC >::PCType

Our preconditioner type.

Constructor & Destructor Documentation

template<class GridType , class PC >
Opm::Elasticity::ElasticityUpscale< GridType, PC >::ElasticityUpscale ( const GridType &  gv_,
ctype  tol_,
ctype  Escale_,
const std::string &  file,
const std::string &  rocklist,
bool  verbose_ 
)
inline

Main constructor.

Parameters
[in]gv_The grid to operate on
[in]tol_The tolerance to use when deciding whether or not a coordinate falls on a plane/line/point.
See also
tol
Parameters
[in]Escale_A scale value for E-moduluses to avoid numerical issues
[in]fileThe eclipse grid file
[in]rocklistIf not blank, file is a rocklist
[in]verboseIf true, give verbose output

Member Function Documentation

template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::addMPC ( Direction  dir,
int  slave,
const BoundaryGrid::Vertex m 
)

Add a MPC equation.

Parameters
[in]dirThe direction of the MPC
[in]slaveThe slave node index
[in]mThe vertices on the master grid
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::assemble ( int  loadcase,
bool  matrix 
)

Assemble (optionally) stiffness matrix A and load vector.

Parameters
[in]loadcaseThe strain load case. Set to -1 to skip
[in]matrixWhether or not to assemble the matrix
template<class GridType , class PC >
template<int comp>
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::averageStress ( Dune::FieldVector< ctype, comp > &  sigma,
const Vector u,
int  loadcase 
)

Calculate the average stress vector for the given loadcase.

Parameters
[out]sigmaThe stress vector
[in]uThe displacement vector
[in]loadcaseThe strain load case considered
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::findBoundaries ( double *  min,
double *  max 
)

Find boundary coordinates.

Parameters
[out]minThe miminum coordinates of the grid
[out]maxThe maximum coordinates of the grid
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::fixCorners ( const double *  min,
const double *  max 
)

Fix corner nodes.

Parameters
[in]minThe minimum coordinates on the grid
[in]maxThe maximum coordinates on the grid
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::periodicBCs ( const double *  min,
const double *  max 
)

Establish periodic boundaries using the MPC approach.

Parameters
[in]minThe minimum coordinates of the grid
[in]maxThe maximum coordinates of the grid
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::periodicBCsMortar ( const double *  min,
const double *  max,
int  n1,
int  n2,
int  p1,
int  p2 
)

Establish periodic boundaries using the mortar approach.

Parameters
[in]minThe minimum coordinates of the grid
[in]maxThe maximum coordinates of the grid
[in]n1The number of elements on the lambda grid in the X direction
[in]n2The number of elements on the lambda grid in the Y direction
[in]p1The order of multipliers in the X direction
[in]p2The order of multipliers in the Y direction
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::setupSolvers ( const LinSolParams params)
Parameters
[in]paramsThe linear solver parameters
template<class GridType , class PC >
void Opm::Elasticity::ElasticityUpscale< GridType, PC >::solve ( int  loadcase)

Solve Au = b for u.

Parameters
[in]loadcaseThe load case to solve

Member Data Documentation

template<class GridType , class PC >
ASMHandler<GridType> Opm::Elasticity::ElasticityUpscale< GridType, PC >::A

The linear operator.

template<class GridType , class PC >
Vector Opm::Elasticity::ElasticityUpscale< GridType, PC >::b[6]

The load vectors.

template<class GridType , class PC >
bool Opm::Elasticity::ElasticityUpscale< GridType, PC >::bySat

Are volume fractions grouped by SATNUM?

template<class GridType , class PC >
const int Opm::Elasticity::ElasticityUpscale< GridType, PC >::dim = GridType::dimension
static

Dimension of our grid.

template<class GridType , class PC >
Vector Opm::Elasticity::ElasticityUpscale< GridType, PC >::u[6]

The solution vectors.

template<class GridType , class PC >
double Opm::Elasticity::ElasticityUpscale< GridType, PC >::upscaledRho

Upscaled density.

template<class GridType , class PC >
std::vector<double> Opm::Elasticity::ElasticityUpscale< GridType, PC >::volumeFractions

Vector holding the volume fractions for materials (grouped by SATNUM)


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