Geometry.hpp
Go to the documentation of this file.
183 // Meaningless to call jacobianTransposed() on singular geometries. But we need to make DUNE happy.
191 // Meaningless to call jacobianInverseTransposed() on singular geometries. But we need to make DUNE happy.
327 OPM_THROW(std::runtime_error, "Meaningless to call jacobianTransposed() on singular geometries.");
334 OPM_THROW(std::runtime_error, "Meaningless to call jacobianInverseTransposed() on singular geometries.");
673 const auto localCoordNumerator = []( const std::vector<double>& vec, int sumLimit, double multiplier) {
707 local_x = localCoordNumerator(widthsX, i/cells_per_dim[0], double((i % cells_per_dim[0])) / cells_per_dim[0]);
712 local_y = localCoordNumerator(lengthsY, j/cells_per_dim[1], double((j % cells_per_dim[1])) / cells_per_dim[1]);
717 local_z = localCoordNumerator(heightsZ, k/cells_per_dim[2], double((k % cells_per_dim[2])) /cells_per_dim[2]);
720 const LocalCoordinate& local_refined_corner = { local_x/sumWidths, local_y/sumLengths, local_z/sumHeights };
725 // Compute the global refined corner 'jik' and add it in its corresponfing entry in "refined_corners".
779 // 0 -> 3rd coordinate constant: l('k') < cells_per_dim[2]+1, m('j') < cells_per_dim[1], n('i') < cells_per_dim[0]
780 // 1 -> 1rt coordinate constant: l('i') < cells_per_dim[0]+1, m('k') < cells_per_dim[2], n('j') < cells_per_dim[1]
781 // 2 -> 2nd coordinate constant: l('j') < cells_per_dim[1]+1, m('i') < cells_per_dim[0], n('k') < cells_per_dim[2]
863 // then the indices grow first picking the cells in the x-axis (Right, i), then y-axis (Back, j), and
900 // "hexa_face_centroids" (Vol2.), global refined cell center (Vol3.), and "tetra_edge_indices" (Vol4.).
916 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k, // fake '3' {1,1,0}
918 (j*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1, // fake '5' {1,0,1}
919 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + (i*(refined_dim[2]+1)) +k+1, // fake '6' {0,1,1}
920 ((j+1)*(refined_dim[0]+1)*(refined_dim[2]+1)) + ((i+1)*(refined_dim[2]+1)) +k+1 // fake '7' {1,1,1}
933 // Vol1. INDICES ('from 0 to 5') of the faces of the hexahedron (needed to access face centroids).
1039 // Rescale all volumes if the sum of volume of all the global refined 'cells' does not match the
1074 getIndicesFace(int l, int m, int n, int constant_direction, const std::array<int, 3>& cells_per_dim) const
1145 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:267 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:102 bool affine() const The mapping implemented by this geometry is constant, therefore affine. Definition: Geometry.hpp:210 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:105 JacobianInverse jacobianInverse(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:204 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:100 Jacobian jacobian(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:197 double integrationElement(const LocalCoordinate &) const Returns 1 for the vertex geometry. Definition: Geometry.hpp:141 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:111 Geometry(const GlobalCoordinate &pos) Construct from vertex position. Definition: Geometry.hpp:116 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:107 JacobianTransposed jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:180 GeometryType type() const Using the cube type for vertices. Definition: Geometry.hpp:147 ctype volume() const Volume of vertex is arbitrarily set to 1. Definition: Geometry.hpp:167 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:109 GlobalCoordinate corner(int cor) const Returns the single corner: the vertex itself. Definition: Geometry.hpp:159 int corners() const A vertex is defined by a single corner. Definition: Geometry.hpp:153 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:173 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:122 const GlobalCoordinate & global(const LocalCoordinate &) const Returns the position of the vertex. Definition: Geometry.hpp:128 JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:189 LocalCoordinate local(const GlobalCoordinate &) const Meaningless for the vertex geometry. Definition: Geometry.hpp:134 double ctype Coordinate element type. Definition: Geometry.hpp:97 Definition: Geometry.hpp:226 JacobianInverse jacobianInverse(const LocalCoordinate &) const The inverse of the jacobian. Definition: Geometry.hpp:346 const FieldMatrix< ctype, mydimension, coorddimension > & jacobianTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:325 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:318 LocalCoordinate local(const GlobalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:277 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:247 bool affine() const Since integrationElement() is constant, returns true. Definition: Geometry.hpp:352 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:242 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:253 ctype volume() const Volume (area, actually) of intersection. Definition: Geometry.hpp:312 const FieldMatrix< ctype, coorddimension, mydimension > & jacobianInverseTransposed(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:332 GeometryType type() const We use the singular type (None) for intersections. Definition: Geometry.hpp:290 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:251 double integrationElement(const LocalCoordinate &) const Definition: Geometry.hpp:284 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:265 const GlobalCoordinate & global(const LocalCoordinate &) const This method is meaningless for singular geometries. Definition: Geometry.hpp:271 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:249 Geometry(const GlobalCoordinate &pos, ctype vol) Construct from centroid and volume (1- and 0-moments). Definition: Geometry.hpp:258 double ctype Coordinate element type. Definition: Geometry.hpp:239 Jacobian jacobian(const LocalCoordinate &) const The jacobian. Definition: Geometry.hpp:339 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:244 GlobalCoordinate corner(int) const This method is meaningless for singular geometries. Definition: Geometry.hpp:303 Specialization for 3-dimensional geometries, i.e. cells. Definition: Geometry.hpp:369 const JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local_coord) const Inverse of Jacobian transposed. Definition: Geometry.hpp:586 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed Type of the inverse of the transposed Jacobian matrix. Definition: Geometry.hpp:396 bool affine() const The mapping implemented by this geometry is not generally affine. Definition: Geometry.hpp:608 double ctype Coordinate element type. Definition: Geometry.hpp:382 void set_volume(ctype volume) Definition: Geometry.hpp:533 FieldVector< ctype, coorddimension > GlobalCoordinate Range type of. Definition: Geometry.hpp:387 GlobalCoordinate corner(int cor) const Get the cor-th of 8 corners of the hexahedral base cell. Definition: Geometry.hpp:521 FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed Type of transposed Jacobian matrix. Definition: Geometry.hpp:394 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:408 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:632 double integrationElement(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:500 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:550 GlobalCoordinate global(const LocalCoordinate &local_coord) const Definition: Geometry.hpp:444 Geometry() Default constructor, giving a non-valid geometry. Definition: Geometry.hpp:434 FieldMatrix< ctype, coorddimension, mydimension > JacobianInverse Type of inverse of Jacobian matrix. Definition: Geometry.hpp:392 LocalCoordinate local(const GlobalCoordinate &y) const Definition: Geometry.hpp:475 ctype volume() const Cell volume. Definition: Geometry.hpp:528 const GlobalCoordinate & center() const Returns the centroid of the geometry. Definition: Geometry.hpp:538 Jacobian jacobian(const LocalCoordinate &local_coord) const The jacobian. Definition: Geometry.hpp:595 Geometry(const GlobalCoordinate &pos, ctype vol) Construct from centroid and volume (1- and 0-moments). Note that since corners are not given,... Definition: Geometry.hpp:427 Dune::FieldVector< double, 3 > PointType Refine a single cell considering different widths, lengths, and heights. Definition: Geometry.hpp:631 FieldVector< ctype, mydimension > LocalCoordinate Domain type of. Definition: Geometry.hpp:385 Dune::Impl::FieldMatrixHelper< double > MatrixHelperType Definition: Geometry.hpp:398 JacobianInverse jacobianInverse(const LocalCoordinate &local_coord) const The inverse of the jacobian. Definition: Geometry.hpp:602 FieldMatrix< ctype, coorddimension, mydimension > Jacobian Type of Jacobian matrix. Definition: Geometry.hpp:390 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 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:137 auto referenceElement(const cpgrid::Geometry< mydim, cdim > &geo) -> decltype(referenceElement< double, mydim >(geo.type())) Definition: Geometry.hpp:1145 |