Commit 80afc0b7 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/use-entity-type' into 'master'

Use entity.type() instead of creating a temporary geometry

See merge request !1686
parents 1b1140f7 7ee2bc33
......@@ -143,7 +143,7 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void bindElement(const Element& element)
{
elemGeometryType_ = element.geometry().type();
elemGeometryType_ = element.type();
eIdx_ = fvGridGeometry().elementMapper().index(element);
}
......
......@@ -565,7 +565,7 @@ public:
{
if (!is.neighbor() && !is.boundary())
{
const auto refElement = ReferenceElements::general(element.geometry().type());
const auto refElement = ReferenceElements::general(element.type());
for (int isVertex = 0; isVertex < is.geometry().corners(); ++isVertex)
{
......
......@@ -120,7 +120,7 @@ public:
for (auto bulkElemIdx : adjoinedEntityIndices)
{
const auto bulkElement = bulkFvGridGeometry.element(bulkElemIdx);
const auto bulkRefElem = BulkReferenceElements::general(bulkElement.geometry().type());
const auto bulkRefElem = BulkReferenceElements::general(bulkElement.type());
// find the bulk element facet that lies on this low dim element (assumes conformity!)
bool found = false;
......
......@@ -134,7 +134,7 @@ public:
//! For compatibility reasons with the FVGeometry cache being disabled
void bindElement(const Element& element)
{
elemGeometryType_ = element.geometry().type();
elemGeometryType_ = element.type();
eIdx_ = fvGridGeometry().elementMapper().index(element);
}
......
......@@ -170,7 +170,7 @@ public:
bool isOnFacetGrid(const BulkGridElement& element, const BulkGridIntersection& intersection) const
{
// Intersection lies on facet grid, if the corners of the intersection make up a facet element
const auto refElement = BulkReferenceElements::general(element.geometry().type());
const auto refElement = BulkReferenceElements::general(element.type());
const auto numCorners = intersection.geometry().corners();
const auto facetIdx = intersection.indexInInside();
......
......@@ -103,7 +103,7 @@ public:
const auto eIdx = elementMapper.index(e);
std::vector<unsigned int> handledFacets;
const auto refElement = ReferenceElements::general(e.geometry().type());
const auto refElement = ReferenceElements::general(e.type());
for (const auto& is : intersections(gridView, e))
{
// do not start path search on boundary intersections
......@@ -273,7 +273,7 @@ private:
if (std::find(path.begin(), path.end(), outsideElemIdx) == path.end())
{
const auto idxInOutside = is.indexInOutside();
const auto outsideRefElement = ReferenceElements::general(outsideElement.geometry().type());
const auto outsideRefElement = ReferenceElements::general(outsideElement.type());
path.push_back(outsideElemIdx);
// on 2d grids, there is only going to be one more
......
......@@ -83,7 +83,7 @@ public:
using ReferenceElements = typename Dune::ReferenceElements<typename GridView::ctype, dim>;
for (const auto& e : elements(gridView))
{
const auto refElem = ReferenceElements::general(e.geometry().type());
const auto refElem = ReferenceElements::general(e.type());
for (const auto& is : intersections(gridView, e))
if (is.boundary())
for (int i = 0; i < is.geometry().corners(); ++i)
......@@ -108,7 +108,7 @@ public:
// otherwise, we check for immersed boundaries where we also must not enrich
else
{
const auto refElem = CodimOneReferenceElements::general(codimOneElement.geometry().type());
const auto refElem = CodimOneReferenceElements::general(codimOneElement.type());
for (const auto& intersection : intersections(codimOneGridView, codimOneElement))
{
// skip if intersection is not on boundary
......
......@@ -733,7 +733,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo()
// get the intersection node /bar^{x_3} between 'intersection12'
// and 'intersection14', denoted as 'corner1234'
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
GlobalPosition corner1234(0);
......@@ -1635,7 +1635,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble()
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......
......@@ -776,7 +776,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo()
// get index
int eIdxGlobal1 = problem_.variables().index(element);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const auto isEndIt12 = problem_.gridView().iend(element);
for (auto isIt12 = problem_.gridView().ibegin(element); isIt12 != isEndIt12; ++isIt12)
......@@ -2350,7 +2350,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble()
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......
......@@ -306,7 +306,7 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
const auto referenceElement = ReferenceElements::general(elementI.type());
int indexInInside = intersection.indexInInside();
int indexInOutside = intersection.indexInOutside();
......
......@@ -344,7 +344,7 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter
CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
const auto referenceElement = ReferenceElements::general(elementI.type());
int indexInInside = intersection.indexInInside();
int indexInOutside = intersection.indexInOutside();
......
......@@ -209,7 +209,7 @@ public:
refVelocity[0] = 0.5 * (fluxW[1] - fluxW[0]);
refVelocity[1] = 0.5 * (fluxW[3] - fluxW[2]);
const DimVector& localPos = ReferenceElements::general(element.geometry().type()).position(0, 0);
const DimVector& localPos = ReferenceElements::general(element.type()).position(0, 0);
// get the transposed Jacobian of the element mapping
const JacobianTransposed jacobianT = element.geometry().jacobianTransposed(localPos);
......@@ -755,7 +755,7 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......@@ -864,7 +864,7 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......
......@@ -307,7 +307,7 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
const auto referenceElement = ReferenceElements::general(elementI.type());
int indexInInside = intersection.indexInInside();
int indexInOutside = intersection.indexInOutside();
......
......@@ -222,7 +222,7 @@ public:
refVelocity[1] = 0.5 * (fluxW[3] - fluxW[2]);
refVelocity[2] = 0.5 * (fluxW[5] - fluxW[4]);
const DimVector& localPos = ReferenceElements::general(element.geometry().type()).position(0, 0);
const DimVector& localPos = ReferenceElements::general(element.type()).position(0, 0);
// get the transposed Jacobian of the element mapping
const JacobianTransposed jacobianT = element.geometry().jacobianTransposed(localPos);
......
......@@ -729,7 +729,7 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo()
// get the intersection node /bar^{x_3} between 'isIt12' and 'isIt14', denoted as 'corner1234'
// initialization of corner1234
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
GlobalPosition corner1234(0);
......@@ -1730,7 +1730,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble()
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......
......@@ -304,7 +304,7 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
const auto referenceElement = ReferenceElements::general(elementI.type());
int indexInInside = intersection.indexInInside();
int indexInOutside = intersection.indexInOutside();
......
......@@ -206,7 +206,7 @@ public:
refVelocity[0] = 0.5 * (fluxW[1] - fluxW[0]);
refVelocity[1] = 0.5 * (fluxW[3] - fluxW[2]);
const DimVector& localPos = ReferenceElements::general(element.geometry().type()).position(0, 0);
const DimVector& localPos = ReferenceElements::general(element.type()).position(0, 0);
// get the transposed Jacobian of the element mapping
const JacobianTransposed jacobianT = element.geometry().jacobianTransposed(localPos);
......@@ -587,7 +587,7 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......@@ -696,7 +696,7 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
{
int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
......
......@@ -1433,7 +1433,7 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect
int localFace24 = face24->indexInInside();
int localFace26 = face26->indexInInside();
const auto referenceElement = ReferenceElementContainer::general(neighbor.geometry().type());
const auto referenceElement = ReferenceElementContainer::general(neighbor.type());
//find 'x'5 = edgeCoord1226
int edge1226;
......
......@@ -145,7 +145,7 @@ public:
*/
void bindElement(const Element& element)
{
elemGeometryType_ = element.geometry().type();
elemGeometryType_ = element.type();
eIdx_ = fvGridGeometry().elementMapper().index(element);
}
......
......@@ -519,7 +519,7 @@ private:
for (const auto& element : elements(gridView))
{
const auto eIdxGlobal = fvGridGeometry.elementMapper().index(element);
const auto referenceElement = ReferenceElements::general(element.geometry().type());
const auto referenceElement = ReferenceElements::general(element.type());
for (const auto& is : intersections(gridView, element))
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment