mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
fix: put elasticity code in the Opm::Elasticity namespace
This commit is contained in:
parent
465c92bef9
commit
fbf45bfc73
@ -23,6 +23,10 @@ typedef Dune::BlockVector<Dune::FieldVector<double,1> > Vector;
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
|
||||
//!\brief Class handling finite element assembly
|
||||
template<class GridType>
|
||||
class ASMHandler {
|
||||
@ -221,3 +225,6 @@ class ASMHandler {
|
||||
};
|
||||
|
||||
#include "asmhandler_impl.hpp"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,9 @@
|
||||
//==============================================================================
|
||||
#include "boundarygrid.hh"
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
BoundaryGrid BoundaryGrid::uniform(const FaceCoord& min, const FaceCoord& max,
|
||||
int k1, int k2, bool dc)
|
||||
{
|
||||
@ -377,3 +380,6 @@ BoundaryGrid::Vertex minXmaxY(std::vector<BoundaryGrid::Vertex>& in)
|
||||
std::sort(s.begin(),s.begin()+2,BoundaryGrid::VertexLess(1));
|
||||
return *(s.begin()+1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief A class describing a quad grid
|
||||
class BoundaryGrid {
|
||||
public:
|
||||
@ -477,3 +480,6 @@ BoundaryGrid::Vertex maxXmaxY(std::vector<BoundaryGrid::Vertex>& in);
|
||||
//! \brief Find the vertex in the vector with minimum X and maximum Y
|
||||
//! \returns The requested vertex
|
||||
BoundaryGrid::Vertex minXmaxY(std::vector<BoundaryGrid::Vertex>& in);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,9 @@
|
||||
//==============================================================================
|
||||
#pragma once
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief Elasticity helper class
|
||||
template<class GridType>
|
||||
class Elasticity {
|
||||
@ -63,3 +66,6 @@ class Elasticity {
|
||||
};
|
||||
|
||||
#include "elasticity_impl.hpp"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,9 @@
|
||||
#include <dune/elasticity/materials.hh>
|
||||
#include <dune/elasticity/mpc.hh>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief An enumeration of available linear solvers
|
||||
enum Solver {
|
||||
SLU,
|
||||
@ -332,3 +335,6 @@ class ElasticityUpscale
|
||||
};
|
||||
|
||||
#include "elasticity_upscale_impl.hpp"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include "materials.hh"
|
||||
#include <fstream>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
Material* Material::create (int ID, const Dune::DynamicVector<double>& params)
|
||||
{
|
||||
@ -135,3 +137,6 @@ Material* Material::create(int ID, const std::string& file)
|
||||
return new Isotropic(ID,E,nu,rho);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,9 @@
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/dynvector.hh>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
|
||||
/*!
|
||||
\brief This is a base class for linear elastic materials.
|
||||
@ -91,3 +94,6 @@ private:
|
||||
int id; //!< External material number
|
||||
double rho; //!< Mass density
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "materials.hh"
|
||||
#include <string.h>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
std::ostream& Isotropic::write (std::ostream& os) const
|
||||
{
|
||||
@ -214,3 +216,6 @@ bool OrthotropicSym::getConstitutiveMatrix (Dune::FieldMatrix<double,3,3>& C,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,9 @@
|
||||
#include "material.hh"
|
||||
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
/*!
|
||||
\brief Isotropic linear elastic material.
|
||||
*/
|
||||
@ -167,3 +170,6 @@ protected:
|
||||
private:
|
||||
double Cupper[21]; //!< Upper triangle of the symmetric constitutive matrix
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@
|
||||
|
||||
#include <dune/istl/bcrsmatrix.hh>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief A sparse matrix holding our operator
|
||||
typedef Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > Matrix;
|
||||
|
||||
@ -52,3 +55,6 @@ class MatrixOps {
|
||||
};
|
||||
|
||||
#include "matrixops_impl.hpp"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,9 @@
|
||||
|
||||
#include "mpc.hh"
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
bool MPC::Less::compareSlaveDofOnly = false;
|
||||
|
||||
|
||||
@ -77,3 +80,6 @@ std::ostream& operator<< (std::ostream& s, const MPC& mpc)
|
||||
}
|
||||
return s << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief An enum for specification of global coordinate directions
|
||||
enum Direction { NONE = 0, X = 1, Y = 2, Z = 4,
|
||||
XY = 1+2, XZ = 1+4, YZ = 2+4,
|
||||
@ -153,3 +156,6 @@ typedef std::set<MPC*,MPC::Less> MPCSet;
|
||||
|
||||
//! \brief A mapping from dof to MPCs
|
||||
typedef std::map<int,MPC*> MPCMap;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
|
||||
//! \brief Represents a linear shape function on a Q4/Q8 element
|
||||
template<class ctype, class rtype, int dim>
|
||||
class LinearShapeFunction
|
||||
@ -169,3 +172,6 @@ private:
|
||||
//! \brief Our shape functions
|
||||
ShapeFunction f[n];
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ struct Params {
|
||||
//! \brief Maximum grid coordinates
|
||||
double max[3];
|
||||
//! \brief The linear solver to employ
|
||||
Solver solver;
|
||||
Opm::Elasticity::Solver solver;
|
||||
|
||||
// Debugging options
|
||||
//! \brief Number of elements on interface grid in the x direction (LLM)
|
||||
@ -119,9 +119,9 @@ void parseCommandLine(int argc, char** argv, Params& p)
|
||||
//std::string solver = param.getDefault<std::string>("linsolver_type","slu");
|
||||
std::string solver = param.getDefault<std::string>("linsolver_type","cg");
|
||||
if (solver == "cg")
|
||||
p.solver = CG;
|
||||
p.solver = Opm::Elasticity::CG;
|
||||
else
|
||||
p.solver = SLU;
|
||||
p.solver = Opm::Elasticity::SLU;
|
||||
if (p.file == "uniform") {
|
||||
p.cellsx = param.getDefault("cellsx",3);
|
||||
p.cellsy = param.getDefault("cellsy",3);
|
||||
@ -178,8 +178,9 @@ void writeOutput(const Params& p, Opm::time::StopWatch& watch, int cells,
|
||||
}
|
||||
f << "# Options used:" << std::endl
|
||||
<< "#\t method: " << method << std::endl
|
||||
<< "#\t linsolver_type: " << (p.solver==SLU?"slu":"cg") << std::endl;
|
||||
if (p.solver == CG)
|
||||
<< "#\t linsolver_type: " << (p.solver==Opm::Elasticity::SLU?"slu":"cg")
|
||||
<< std::endl;
|
||||
if (p.solver == Opm::Elasticity::CG)
|
||||
f << "#\t ltol: " << p.ltol << std::endl;
|
||||
if (p.file == "uniform") {
|
||||
f << "#\t cellsx: " << p.cellsx << std::endl
|
||||
@ -229,7 +230,7 @@ int main(int argc, char** argv)
|
||||
grid.readEclipseFormat(p.file,p.ctol,false);
|
||||
|
||||
typedef GridType::ctype ctype;
|
||||
ElasticityUpscale<GridType> upscale(grid, p.ctol, p.Emin, p.file, p.rocklist);
|
||||
Opm::Elasticity::ElasticityUpscale<GridType> upscale(grid, p.ctol, p.Emin, p.file, p.rocklist);
|
||||
if (p.max[0] < 0 || p.min[0] < 0) {
|
||||
std::cout << "determine side coordinates..." << std::endl;
|
||||
upscale.findBoundaries(p.min,p.max);
|
||||
|
Loading…
Reference in New Issue
Block a user