Geometry.hpp
Go to the documentation of this file.
186 // Meaningless to call jacobianTransposed() on singular geometries. But we need to make DUNE happy.
194 // Meaningless to call jacobianInverseTransposed() on singular geometries. But we need to make DUNE happy.
332 OPM_THROW(std::runtime_error, "Meaningless to call jacobianTransposed() on singular geometries.");
339 OPM_THROW(std::runtime_error, "Meaningless to call jacobianInverseTransposed() on singular geometries.");
665 const auto localCoordNumerator = []( const std::vector<double>& vec, int sumLimit, double multiplier) {
699 local_x = localCoordNumerator(widthsX, i/cells_per_dim[0], double((i % cells_per_dim[0])) / cells_per_dim[0]);
704 local_y = localCoordNumerator(lengthsY, j/cells_per_dim[1], double((j % cells_per_dim[1])) / cells_per_dim[1]);
709 local_z = localCoordNumerator(heightsZ, k/cells_per_dim[2], double((k % cells_per_dim[2])) /cells_per_dim[2]);
712 const LocalCoordinate& local_refined_corner = { local_x/sumWidths, local_y/sumLengths, local_z/sumHeights };
717 // Compute the global refined corner 'jik' and add it in its corresponfing entry in "refined_corners".
771 // 0 -> 3rd coordinate constant: l('k') < cells_per_dim[2]+1, m('j') < cells_per_dim[1], n('i') < cells_per_dim[0]
772 // 1 -> 1rt coordinate constant: l('i') < cells_per_dim[0]+1, m('k') < cells_per_dim[2], n('j') < cells_per_dim[1]
773 // 2 -> 2nd coordinate constant: l('j') < cells_per_dim[1]+1, m('i') < cells_per_dim[0], n('k') < cells_per_dim[2]
855 // then the indices grow first picking the cells in the x-axis (Right, i), then y-axis (Back, j), and
892 // "hexa_face_centroids" (Vol2.), global refined cell center (Vol3.), and "tetra_edge_indices" (Vol4.).
908 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k, // fake '3' {1,1,0}
910 (j*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1, // fake '5' {1,0,1}
911 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + (i*(refined_dim[2]+1)) +k+1, // fake '6' {0,1,1}
912 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1 // fake '7' {1,1,1}
925 // Vol1. INDICES ('from 0 to 5') of the faces of the hexahedron (needed to access face centroids).
1031 // Rescale all volumes if the sum of volume of all the global refined 'cells' does not match the
1066 getIndicesFace(int l, int m, int n, int constant_direction, const std::array<int, 3>& cells_per_dim) const
1137 auto referenceElement(const cpgrid::Geometry<mydim,cdim>& geo) -> decltype(referenceElement<double,mydim>(geo.type()))
Definition: DefaultGeometryPolicy.hpp:53 const EntityVariable< cpgrid::Geometry< 3 - codim, 3 >, codim > & geomVector() const Definition: DefaultGeometryPolicy.hpp:86 Represents an entity of a given codim, with positive or negative orientation. Definition: EntityRep.hpp:99 Base class for EntityVariable and SignedEntityVariable. Forwards a restricted subset of the std::vect... Definition: EntityRep.hpp:219 A class design to hold a variable with a value for each entity of the given codimension,... Definition: EntityRep.hpp:272 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:105 bool affine() const The mapping implemented by this geometry is constant, therefore affine. Definition: Geometry.hpp:213 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:108 JacobianInverse jacobianInverse(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:207 Volume volume() const Volume of vertex is arbitrarily set to 1. Definition: Geometry.hpp:170 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:103 Jacobian jacobian(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:200 double ctype Coordinate element type. Definition: Geometry.hpp:98 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:114 Geometry(const GlobalCoordinate &pos) Construct from vertex position. Definition: Geometry.hpp:119 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:110 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:100 JacobianTransposed jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:183 GeometryType type() const Using the cube type for vertices. Definition: Geometry.hpp:150 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:112 GlobalCoordinate corner(int cor) const Returns the single corner: the vertex itself. Definition: Geometry.hpp:162 int corners() const A vertex is defined by a single corner. Definition: Geometry.hpp:156 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:176 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:125 const GlobalCoordinate & global(const LocalCoordinate &) const Returns the position of the vertex. Definition: Geometry.hpp:131 Volume integrationElement(const LocalCoordinate &) const Returns 1 for the vertex geometry. Definition: Geometry.hpp:144 JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:192 LocalCoordinate local(const GlobalCoordinate &) const Meaningless for the vertex geometry. Definition: Geometry.hpp:137 Definition: Geometry.hpp:229 JacobianInverse jacobianInverse(const LocalCoordinate &) const The inverse of the jacobian. Definition: Geometry.hpp:351 Volume volume() const Volume (area, actually) of intersection. Definition: Geometry.hpp:317 const FieldMatrix< ctype, mydimension, coorddimension > & jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:330 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:323 Volume integrationElement(const LocalCoordinate &) const Definition: Geometry.hpp:289 LocalCoordinate local(const GlobalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:282 double ctype Coordinate element type. Definition: Geometry.hpp:242 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:252 bool affine() const Since integrationElement() is constant, returns true. Definition: Geometry.hpp:357 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:244 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:247 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:258 const FieldMatrix< ctype, coorddimension, mydimension > & jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:337 GeometryType type() const We use the singular type (None) for intersections. Definition: Geometry.hpp:295 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:256 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:270 const GlobalCoordinate & global(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:276 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:254 Geometry(const GlobalCoordinate &pos, ctype vol) Construct from centroid and volume (1- and 0-moments). Definition: Geometry.hpp:263 Jacobian jacobian(const LocalCoordinate &) const The jacobian. Definition: Geometry.hpp:344 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:249 GlobalCoordinate corner(int) const This method is meaningless for singular geometries. Definition: Geometry.hpp:308 Specialization for 3-dimensional geometries, i.e. cells. Definition: Geometry.hpp:374 const JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local_coord) const Inverse of Jacobian transposed. Definition: Geometry.hpp:578 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:403 bool affine() const The mapping implemented by this geometry is not generally affine. Definition: Geometry.hpp:600 void set_volume(ctype volume) Definition: Geometry.hpp:525 Volume volume() const Cell volume. Definition: Geometry.hpp:520 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:394 GlobalCoordinate corner(int cor) const Get the cor-th of 8 corners of the hexahedral base cell. Definition: Geometry.hpp:513 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:401 Geometry(const GlobalCoordinate &pos, ctype vol, std::shared_ptr< const EntityVariable< cpgrid::Geometry< 0, 3 >, 3 > > allcorners_ptr, const int *corner_indices) Construct from center, volume (1- and 0-moments) and corners. Definition: Geometry.hpp:415 void refineCellifiedPatch(const std::array< int, 3 > &cells_per_dim, DefaultGeometryPolicy &all_geom, std::vector< std::array< int, 8 > > &refined_cell_to_point, cpgrid::OrientedEntityTable< 0, 1 > &refined_cell_to_face, Opm::SparseTable< int > &refined_face_to_point, cpgrid::OrientedEntityTable< 1, 0 > &refined_face_to_cell, cpgrid::EntityVariable< enum face_tag, 1 > &refined_face_tags, cpgrid::SignedEntityVariable< PointType, 1 > &refined_face_normals, const std::array< int, 3 > &patch_dim, const std::vector< double > &widthsX, const std::vector< double > &lengthsY, const std::vector< double > &heightsZ) const Definition: Geometry.hpp:624 const JacobianTransposed jacobianTransposed(const LocalCoordinate &local_coord) const Jacobian transposed. J^T_{ij} = (dg_j/du_i) where g is the mapping from the reference domain,... Definition: Geometry.hpp:542 GlobalCoordinate global(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:436 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:426 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:399 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:389 LocalCoordinate local(const GlobalCoordinate &y) const Definition: Geometry.hpp:467 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:530 Jacobian jacobian(const LocalCoordinate &local_coord) const The jacobian. Definition: Geometry.hpp:587 Dune::FieldVector< double, 3 > PointType Refine a single cell considering different widths, lengths, and heights. Definition: Geometry.hpp:623 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:392 Dune::Impl::FieldMatrixHelper< double > MatrixHelperType Definition: Geometry.hpp:405 Volume integrationElement(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:492 JacobianInverse jacobianInverse(const LocalCoordinate &local_coord) const The inverse of the jacobian. Definition: Geometry.hpp:594 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:397 double ctype Coordinate element type. Definition: Geometry.hpp:387 Definition: Geometry.hpp:76 void appendRow(DataIter row_beg, DataIter row_end) Appends a row to the table. Definition: SparseTable.hpp:108 void appendRow(DataIter row_beg, DataIter row_end) Appends a row to the table. Definition: SparseTable.hpp:108 auto referenceElement(const Entity< codim > &) Definition: Entity.hpp:303 The namespace Dune is the main namespace for all Dune code. Definition: common/CartesianIndexMapper.hpp:10 T volume(const Point< T, 3 > *c) Computes the volume of a 3D simplex (embedded i 3D space). Definition: Volumes.hpp:138 |