My Project
|
Allows model geometry data to be passed to external code - via a copy direct to input pointers. More...
#include <opm/common/ErrorMacros.hpp>
#include <dune/grid/common/partitionset.hh>
#include <iosfwd>
#include <string>
Go to the source code of this file.
Classes | |
class | Opm::GridDataOutput::SimMeshDataAccessor< GridView, partitions > |
Namespaces | |
namespace | Opm |
This file contains a set of helper functions used by VFPProd / VFPInj. | |
Enumerations | |
enum | Opm::GridDataOutput::ConnectivityVertexOrder { DUNE = 0 , VTK = 1 } |
Allows selection of order of vertices in writeConnectivity() | |
Allows model geometry data to be passed to external code - via a copy direct to input pointers.
This data extractor provides the full set of vertices (corresponding to Dune::Partition::all) and then allows a user to specify Dune sub-partitions to get the references into the vertex array and element (aka cell) types for the sub-partition. This allows the full set of vertices to be reused for visualisation of the various sub-partitions, at the expense of copying all the vertices. Typically a user is interested in the interiorBorder elements which make use of the bulk (~80%) of the vertices. This saves having to renumber the indexes to the vertices for the sub-partitions. The vertex data can be retrieved as seperate x, y and z arrays, or as a single array of array of structures, or as single structure of arrays based array.
Example:
From the opm-simulators repository #include <opm/simulators/utils/GridDataOutput.hpp>
N.B. does not seem to be able to be allocated with new operator. Opm::GridDataOutput::SimMeshDataAccessor geomData(gridView, Dune::Partition::interior );
geomData.printGridDetails();
int nvert = geomData.getNVertices(); example using seperate x, y and z arrays int nvert = geomData.getNVertices(); double * x_vert = new double[nvert]; double * y_vert = new double[nvert]; double * z_vert = new double[nvert]; geomData.writeGridPoints(x_vert,y_vert,z_vert, nvert);
... do something with vertex data x_vert, y_vert and z_vert ....
delete [] x_vert; delete [] y_vert; delete [] z_vert;
example using AOS double * xyz_vert_aos = new double[nvert*3]; geomData.writeGridPoints_AOS(xyz_vert_aos, nvert);
... do something with vertex data xyz_vert_aos....
delete [] xyz_vert_aos;
example using SOA with std::vector<double> std::vector<double> xyz_vert_soa(nvert*3); geomData.writeGridPoints_SOA(xyz_vert_soa);
... do something with vertex data xyz_vert_soa....