25#ifndef TPSA_FACE_PROPERTIES_HPP
26#define TPSA_FACE_PROPERTIES_HPP
28#include <dune/common/fvector.hh>
30#include <opm/grid/LookUpData.hh>
47template<
class Gr
id,
class Gr
idView,
class ElementMapper,
class CartesianIndexMapper,
class Scalar>
50 enum { dimWorld = GridView::dimensionworld };
53 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
56 const GridView& gridView,
57 const CartesianIndexMapper& cartMapper,
59 std::function<std::array<double, dimWorld>(
int)> centroids);
65 Scalar
weightAverage(
unsigned elemIdx1,
unsigned elemIdx2)
const;
67 Scalar
weightProduct(
unsigned elemIdx1,
unsigned elemIdx2)
const;
78 {
return sModulus_[elemIdx]; }
90 template <
class Intersection>
94 DimVector& faceNormal,
95 std::false_type)
const;
97 template <
class Intersection>
101 DimVector& faceNormal,
102 std::true_type)
const;
104 Scalar
computeDistance_(
const DimVector& distVec,
const DimVector& faceNormal);
108 DimVector
distanceVector_(
const DimVector& faceCenter,
const unsigned& cellIdx)
const;
112 std::vector<Scalar> sModulus_;
113 std::unordered_map<std::uint64_t, Scalar> weightsAvg_;
114 std::unordered_map<std::uint64_t, Scalar> weightsProd_;
115 std::unordered_map<std::uint64_t, Scalar> distance_;
116 std::unordered_map<std::uint64_t, DimVector> faceNormal_;
118 std::map<std::pair<unsigned, unsigned>, Scalar> weightsAvgBoundary_;
119 std::map<std::pair<unsigned, unsigned>, Scalar> weightsProdBoundary_;
120 std::map<std::pair<unsigned, unsigned>, Scalar> distanceBoundary_;
121 std::map<std::pair<unsigned, unsigned>, DimVector> faceNormalBoundary_;
123 const EclipseState& eclState_;
124 const GridView& gridView_;
125 const CartesianIndexMapper& cartMapper_;
127 std::function<std::array<double, dimWorld>(
int)> centroids_;
128 std::vector<std::array<double, dimWorld>> centroids_cache_;
136 std::uint64_t isIdTPSA(std::uint32_t elemIdx1, std::uint32_t elemIdx2);
void extractSModulus_()
Extract shear modulus from eclState.
Definition FacePropertiesTPSA_impl.hpp:553
void finishInit()
Compute TPSA face properties.
Definition FacePropertiesTPSA_impl.hpp:96
const Scalar shearModulus(unsigned elemIdx) const
Return shear modulus of an element.
Definition FacePropertiesTPSA.hpp:77
void computeCellProperties(const Intersection &intersection, FaceInfo &inside, FaceInfo &outside, DimVector &faceNormal, std::false_type) const
Compute face properties from general DUNE grid.
Definition FacePropertiesTPSA_impl.hpp:458
Scalar weightProduct(unsigned elemIdx1, unsigned elemIdx2) const
Product of weights at interface between two elements.
Definition FacePropertiesTPSA_impl.hpp:342
DimVector cellFaceNormal(unsigned elemIdx1, unsigned elemIdx2)
Cell face normal at interface between two elements.
Definition FacePropertiesTPSA_impl.hpp:401
Scalar weightAverage(unsigned elemIdx1, unsigned elemIdx2) const
Average (half-)weight at interface between two elements.
Definition FacePropertiesTPSA_impl.hpp:303
Scalar normalDistanceBoundary(unsigned elemIdx1, unsigned boundaryFaceIdx) const
Distance to boundary interface.
Definition FacePropertiesTPSA_impl.hpp:384
Scalar weightAverageBoundary(unsigned elemIdx1, unsigned boundaryFaceIdx) const
Average (half-)weight at boundary interface.
Definition FacePropertiesTPSA_impl.hpp:328
const DimVector & cellFaceNormalBoundary(unsigned elemIdx1, unsigned boundaryFaceIdx) const
Cell face normal of boundary interface.
Definition FacePropertiesTPSA_impl.hpp:423
Scalar computeWeight_(const Scalar distance, const Scalar smod)
Compute weight ratio between distance and shear modulus.
Definition FacePropertiesTPSA_impl.hpp:517
void update()
Compute TPSA face properties.
Definition FacePropertiesTPSA_impl.hpp:106
Scalar computeDistance_(const DimVector &distVec, const DimVector &faceNormal)
Compute normal distance from cell center to face center.
Definition FacePropertiesTPSA_impl.hpp:440
DimVector distanceVector_(const DimVector &faceCenter, const unsigned &cellIdx) const
Distance vector from cell center to face center.
Definition FacePropertiesTPSA_impl.hpp:532
Scalar normalDistance(unsigned elemIdx1, unsigned elemIdx2) const
Distance between two elements.
Definition FacePropertiesTPSA_impl.hpp:370
FacePropertiesTPSA(const EclipseState &eclState, const GridView &gridView, const CartesianIndexMapper &cartMapper, const Grid &grid, std::function< std::array< double, dimWorld >(int)> centroids)
Constructor.
Definition FacePropertiesTPSA_impl.hpp:77
Scalar weightProductBoundary(unsigned elemIdx1, unsigned boundaryFaceIdx) const
Product of weights at boundary interface.
Definition FacePropertiesTPSA_impl.hpp:356
Definition GenericThresholdPressure.hpp:40
Definition FlowGenericProblem.hpp:51
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
Definition FacePropertiesTPSA.hpp:83