Geometry.hpp
Go to the documentation of this file.
185 // Meaningless to call jacobianTransposed() on singular geometries. But we need to make DUNE happy.
193 // Meaningless to call jacobianInverseTransposed() on singular geometries. But we need to make DUNE happy.
331 OPM_THROW(std::runtime_error, "Meaningless to call jacobianTransposed() on singular geometries.");
338 OPM_THROW(std::runtime_error, "Meaningless to call jacobianInverseTransposed() on singular geometries.");
664 const auto localCoordNumerator = []( const std::vector<double>& vec, int sumLimit, double multiplier) {
698 local_x = localCoordNumerator(widthsX, i/cells_per_dim[0], double((i % cells_per_dim[0])) / cells_per_dim[0]);
703 local_y = localCoordNumerator(lengthsY, j/cells_per_dim[1], double((j % cells_per_dim[1])) / cells_per_dim[1]);
708 local_z = localCoordNumerator(heightsZ, k/cells_per_dim[2], double((k % cells_per_dim[2])) /cells_per_dim[2]);
711 const LocalCoordinate& local_refined_corner = { local_x/sumWidths, local_y/sumLengths, local_z/sumHeights };
716 // Compute the global refined corner 'jik' and add it in its corresponfing entry in "refined_corners".
770 // 0 -> 3rd coordinate constant: l('k') < cells_per_dim[2]+1, m('j') < cells_per_dim[1], n('i') < cells_per_dim[0]
771 // 1 -> 1rt coordinate constant: l('i') < cells_per_dim[0]+1, m('k') < cells_per_dim[2], n('j') < cells_per_dim[1]
772 // 2 -> 2nd coordinate constant: l('j') < cells_per_dim[1]+1, m('i') < cells_per_dim[0], n('k') < cells_per_dim[2]
854 // then the indices grow first picking the cells in the x-axis (Right, i), then y-axis (Back, j), and
891 // "hexa_face_centroids" (Vol2.), global refined cell center (Vol3.), and "tetra_edge_indices" (Vol4.).
907 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k, // fake '3' {1,1,0}
909 (j*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1, // fake '5' {1,0,1}
910 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + (i*(refined_dim[2]+1)) +k+1, // fake '6' {0,1,1}
911 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1 // fake '7' {1,1,1}
924 // Vol1. INDICES ('from 0 to 5') of the faces of the hexahedron (needed to access face centroids).
1030 // Rescale all volumes if the sum of volume of all the global refined 'cells' does not match the
1065 getIndicesFace(int l, int m, int n, int constant_direction, const std::array<int, 3>& cells_per_dim) const
1136 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:104 bool affine() const The mapping implemented by this geometry is constant, therefore affine. Definition: Geometry.hpp:212 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:107 JacobianInverse jacobianInverse(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:206 Volume volume() const Volume of vertex is arbitrarily set to 1. Definition: Geometry.hpp:169 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:102 Jacobian jacobian(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:199 double ctype Coordinate element type. Definition: Geometry.hpp:97 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:113 Geometry(const GlobalCoordinate &pos) Construct from vertex position. Definition: Geometry.hpp:118 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:109 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:99 JacobianTransposed jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:182 GeometryType type() const Using the cube type for vertices. Definition: Geometry.hpp:149 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:111 GlobalCoordinate corner(int cor) const Returns the single corner: the vertex itself. Definition: Geometry.hpp:161 int corners() const A vertex is defined by a single corner. Definition: Geometry.hpp:155 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:175 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:124 const GlobalCoordinate & global(const LocalCoordinate &) const Returns the position of the vertex. Definition: Geometry.hpp:130 Volume integrationElement(const LocalCoordinate &) const Returns 1 for the vertex geometry. Definition: Geometry.hpp:143 JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:191 LocalCoordinate local(const GlobalCoordinate &) const Meaningless for the vertex geometry. Definition: Geometry.hpp:136 Definition: Geometry.hpp:228 JacobianInverse jacobianInverse(const LocalCoordinate &) const The inverse of the jacobian. Definition: Geometry.hpp:350 Volume volume() const Volume (area, actually) of intersection. Definition: Geometry.hpp:316 const FieldMatrix< ctype, mydimension, coorddimension > & jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:329 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:322 Volume integrationElement(const LocalCoordinate &) const Definition: Geometry.hpp:288 LocalCoordinate local(const GlobalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:281 double ctype Coordinate element type. Definition: Geometry.hpp:241 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:251 bool affine() const Since integrationElement() is constant, returns true. Definition: Geometry.hpp:356 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:243 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:246 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:257 const FieldMatrix< ctype, coorddimension, mydimension > & jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:336 GeometryType type() const We use the singular type (None) for intersections. Definition: Geometry.hpp:294 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:255 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:269 const GlobalCoordinate & global(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:275 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:253 Geometry(const GlobalCoordinate &pos, ctype vol) Construct from centroid and volume (1- and 0-moments). Definition: Geometry.hpp:262 Jacobian jacobian(const LocalCoordinate &) const The jacobian. Definition: Geometry.hpp:343 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:248 GlobalCoordinate corner(int) const This method is meaningless for singular geometries. Definition: Geometry.hpp:307 Specialization for 3-dimensional geometries, i.e. cells. Definition: Geometry.hpp:373 const JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local_coord) const Inverse of Jacobian transposed. Definition: Geometry.hpp:577 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:402 bool affine() const The mapping implemented by this geometry is not generally affine. Definition: Geometry.hpp:599 void set_volume(ctype volume) Definition: Geometry.hpp:524 Volume volume() const Cell volume. Definition: Geometry.hpp:519 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:393 GlobalCoordinate corner(int cor) const Get the cor-th of 8 corners of the hexahedral base cell. Definition: Geometry.hpp:512 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:400 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:414 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:623 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:541 GlobalCoordinate global(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:435 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:425 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:398 ctype Volume Number type used for the geometry volume. Definition: Geometry.hpp:388 LocalCoordinate local(const GlobalCoordinate &y) const Definition: Geometry.hpp:466 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:529 Jacobian jacobian(const LocalCoordinate &local_coord) const The jacobian. Definition: Geometry.hpp:586 Dune::FieldVector< double, 3 > PointType Refine a single cell considering different widths, lengths, and heights. Definition: Geometry.hpp:622 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:391 Dune::Impl::FieldMatrixHelper< double > MatrixHelperType Definition: Geometry.hpp:404 Volume integrationElement(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:491 JacobianInverse jacobianInverse(const LocalCoordinate &local_coord) const The inverse of the jacobian. Definition: Geometry.hpp:593 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:396 double ctype Coordinate element type. Definition: Geometry.hpp:386 Definition: Geometry.hpp:75 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 cpgrid::Geometry< mydim, cdim > &geo) -> decltype(referenceElement< double, mydim >(geo.type())) Definition: Geometry.hpp:1136 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 |