elasticity_upscale_impl.hpp File Reference

Elasticity upscale class - template implementations. More...

#include <iostream>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
Include dependency graph for elasticity_upscale_impl.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Opm
 
namespace  Opm::Elasticity
 

Macros

#define IMPL_FUNC(A, B)
 

Functions

 Opm::Elasticity::IMPL_FUNC (std::vector< BoundaryGrid::Vertex >, extractFace(Direction dir, ctype coord))
 
 Opm::Elasticity::IMPL_FUNC (BoundaryGrid, extractMasterFace(Direction dir, ctype coord, SIDE side, bool dc))
 
master Opm::Elasticity::push_back (extractMasterFace(Y, min[1]))
 
master Opm::Elasticity::push_back (extractMasterFace(Z, min[2]))
 
slave Opm::Elasticity::push_back (extractFace(X, max[0]))
 
slave Opm::Elasticity::push_back (extractFace(Y, max[1]))
 
slave Opm::Elasticity::push_back (extractFace(Z, max[2]))
 
 Opm::Elasticity::for (LeafVertexIterator it=start;it !=itend;++it)
 
 Opm::Elasticity::IMPL_FUNC (void, addMPC(Direction dir, int slavenode, const BoundaryGrid::Vertex &m))
 
 Opm::Elasticity::IMPL_FUNC (void, periodicPlane(Direction, Direction, const std::vector< BoundaryGrid::Vertex > &slavepointgrid, const BoundaryGrid &mastergrid))
 
static std::vector< std::vector< int > > Opm::Elasticity::renumber (const BoundaryGrid &b, int n1, int n2, int &totalDOFs)
 Static helper to renumber a Q4 mesh to a P_1/P_N lag mesh. More...
 
 Opm::Elasticity::IMPL_FUNC (int, addBBlockMortar(const BoundaryGrid &b1, const BoundaryGrid &interface, int, int n1, int n2, int colofs))
 
 Opm::Elasticity::IMPL_FUNC (void, assembleBBlockMortar(const BoundaryGrid &b1, const BoundaryGrid &interface, int dir, int n1, int n2, int colofs, double alpha))
 
 Opm::Elasticity::IMPL_FUNC (void, fixPoint(Direction dir, GlobalCoordinate coord, const NodeValue &value))
 
 Opm::Elasticity::IMPL_FUNC (bool, isOnPlane(Direction plane, GlobalCoordinate coord, ctype value))
 
 Opm::Elasticity::IMPL_FUNC (void, fixLine(Direction dir, ctype x, ctype y, const NodeValue &value))
 
 Opm::Elasticity::IMPL_FUNC (bool, isOnLine(Direction dir, GlobalCoordinate coord, ctype x, ctype y))
 
 Opm::Elasticity::IMPL_FUNC (bool, isOnPoint(GlobalCoordinate coord, GlobalCoordinate point))
 
 Opm::Elasticity::if (loadcase > -1)
 
 Opm::Elasticity::if (matrix) A.getOperator()=0
 
 Opm::Elasticity::for (int i=0;i< 2;++i)
 
 Opm::Elasticity::IMPL_FUNC (template< int comp > void, averageStress(Dune::FieldVector< ctype, comp > &sigma, const Vector &uarg, int loadcase))
 
 Opm::Elasticity::if (file=="uniform")
 
 Opm::Elasticity::if (deck.hasKeyword("YOUNGMOD") &&deck.hasKeyword("POISSONMOD"))
 
else Opm::Elasticity::if (deck.hasKeyword("LAMEMOD") &&deck.hasKeyword("SHEARMOD"))
 
else Opm::Elasticity::if (deck.hasKeyword("BULKMOD") &&deck.hasKeyword("SHEARMOD"))
 
else Opm::Elasticity::if (deck.hasKeyword("PERMX") &&deck.hasKeyword("PORO"))
 
 Opm::Elasticity::exit (1)
 
 Opm::Elasticity::if (deck.hasKeyword("SATNUM")) satnum
 
 Opm::Elasticity::if (deck.hasKeyword("RHO")) rho
 
 Opm::Elasticity::if (Escale > 0)
 
 Opm::Elasticity::if (satnum.empty())
 
 Opm::Elasticity::if (upscaledRho > 0)
 
 Opm::Elasticity::IMPL_FUNC (void, loadMaterialsFromRocklist(const std::string &file, const std::string &rocklist))
 
 Opm::Elasticity::determineSideFaces (min, max)
 
static std::cout<< "Xslave "<< slave[0].size()<< " "<< "Yslave "<< slave[1].size()<< " "<< "Zslave "<< slave[2].size()<< std::endl;std::cout<< "Xmaster "<< master[0].size()<< " "<< "Ymaster "<< master[1].size()<< " "<< "Zmaster "<< master[2].size()<< std::endl;periodicPlane(X, XYZ, slave[0], master[0]);periodicPlane(Y, XYZ, slave[1], master[1]);periodicPlane(Z, XYZ, slave[2], master[2]);}IMPL_FUNC(void, periodicBCsMortar(const double *min, const double *max, int n1, int n2, int p1, int p2)){ fixCorners(min, max);std::cout<< "\textracting nodes on top face..."<< std::endl;slave.push_back(extractFace(Z, max[2]));std::cout<< "\treconstructing bottom face..."<< std::endl;BoundaryGrid bottom=extractMasterFace(Z, min[2]);std::cout<< "\testablishing couplings on top/bottom..."<< std::endl;periodicPlane(Z, XYZ, slave[0], bottom);std::cout<< "\tinitializing matrix..."<< std::endl;A.initForAssembly();std::cout<< "\treconstructing left face..."<< std::endl;master.push_back(extractMasterFace(X, min[0], LEFT, true));std::cout<< "\treconstructing right face..."<< std::endl;master.push_back(extractMasterFace(X, max[0], RIGHT, true));std::cout<< "\treconstructing front face..."<< std::endl;master.push_back(extractMasterFace(Y, min[1], LEFT, true));std::cout<< "\treconstructing back face..."<< std::endl;master.push_back(extractMasterFace(Y, max[1], RIGHT, true));std::cout<< "\testablished YZ multiplier grid with "<< n2<< "x1"<< " elements"<< std::endl;BoundaryGrid::FaceCoord fmin, fmax;fmin[0]=min[1];fmin[1]=min[2];fmax[0]=max[1];fmax[1]=max[2];BoundaryGrid lambdax=BoundaryGrid::uniform(fmin, fmax, n2, 1, true);fmin[0]=min[0];fmin[1]=min[2];fmax[0]=max[0];fmax[1]=max[2];std::cout<< "\testablished XZ multiplier grid with "<< n1<< "x1"<< " elements"<< std::endl;BoundaryGrid lambday=BoundaryGrid::uniform(fmin, fmax, n1, 1, true);addBBlockMortar(master[0], lambdax, 0, 1, p2, 0);int eqns=addBBlockMortar(master[1], lambdax, 0, 1, p2, 0);addBBlockMortar(master[2], lambday, 1, 1, p1, eqns);int eqns2=addBBlockMortar(master[3], lambday, 1, 1, p1, eqns);MatrixOps::fromAdjacency(B, Bpatt, A.getEqns(), eqns+eqns2);Bpatt.clear();std::cout<< "\tassembling YZ mortar matrix..."<< std::endl;assembleBBlockMortar(master[0], lambdax, 0, 1, p2, 0);assembleBBlockMortar(master[1], lambdax, 0, 1, p2, 0, -1.0);std::cout<< "\tassembling XZ mortar matrix..."<< std::endl;assembleBBlockMortar(master[2], lambday, 1, 1, p1, eqns);assembleBBlockMortar(master[3], lambday, 1, 1, p1, eqns, -1.0);master.clear();slave.clear();} template< class M, class A > void Opm::Elasticity::applyMortarBlock (int i, const Matrix &B, M &T, A &upre)
 
 Opm::Elasticity::if (params.type==ITERATIVE)
 
std::cerr<< "No direct solver available"<< std::endl;exit(1);siz=A.getOperator().N();} for(int i=0;i< 6;++i) b[i].resize(siz);}{ try { Dune::InverseOperatorResult r;u[loadcase].resize(b[loadcase].size());u[loadcase]=0;int solver=0;tsolver[solver]-> Opm::Elasticity::apply (u[loadcase], b[loadcase], r)
 

Variables

 Opm::Elasticity::min [0] = min[1] = min[2] = 1e5
 
const LeafVertexIterator Opm::Elasticity::itend = gv.leafGridView().template end<dim>()
 
LeafVertexIterator Opm::Elasticity::start = gv.leafGridView().template begin<dim>()
 
static const int Opm::Elasticity::bfunc = 4+(dim-2)*4
 
Dune::FieldVector< ctype, comp > Opm::Elasticity::eps0 = 0
 
MaterialMap Opm::Elasticity::cache
 
std::vector< double > Opm::Elasticity::Emod
 
std::vector< double > Opm::Elasticity::Poiss
 
std::vector< int > Opm::Elasticity::satnum
 
std::vector< double > Opm::Elasticity::rho
 
 Opm::Elasticity::upscaledRho = -1
 
 Opm::Elasticity::else
 
auto Opm::Elasticity::deck = parser.parseFile(file)
 
std::vector< int > Opm::Elasticity::cells = gv.globalCell()
 
int Opm::Elasticity::j =0
 
std::map< Material *, double > Opm::Elasticity::volume
 
std::cout<< "Number of materials: "<< cache.size()<< std::endl;double totalvolume=0;for(std::map< Material *, double >::iterator it=volume.begin();it !=volume.end();++it) totalvolume+=it-> Opm::Elasticity::second
 
int Opm::Elasticity::numsolvers = 1
 

Detailed Description

Elasticity upscale class - template implementations.

Date
Nov 9 2011
Author
Arne Morten Kvarving / SINTEF

Macro Definition Documentation

◆ IMPL_FUNC

#define IMPL_FUNC (   A,
 
)
Value:
template<class GridType, class PC> \
A ElasticityUpscale<GridType, PC>::B