version 3.10-dev
Dumux::GstatRandomField< GridView, Scalar > Class Template Reference

Creating random fields using gstat. More...

#include <dumux/material/gstatrandomfield.hh>

Description

template<class GridView, class Scalar>
class Dumux::GstatRandomField< GridView, Scalar >

gstat is an open source software tool which can (among other things) generate geostatistical random fields (see http://www.gstat.org or [67]).

To use this class, execute the installexternal.py from your DuMuX root directory or download, unpack and install the tarball from the gstat-website. Then rerun cmake (in the second case set GSTAT_ROOT in your input file to the path where gstat is installed).

Public Types

enum  FieldType { scalar , log10 }
 

Public Member Functions

 GstatRandomField (const GridView &gridView, const ElementMapper &elementMapper)
 Constructor. More...
 
void create (const std::string &gstatControlFile, const std::string &gstatInputFile="gstatInput.txt", const std::string &gstatOutputFile="permeab.dat", FieldType fieldType=FieldType::scalar, bool createNew=true)
 Creates a new field with random variables, if desired. Otherwise creates a data field from already available data. For the random field generation three files are necessary. More...
 
Scalar data (const Element &e) const
 Return an entry of the data vector. More...
 
const DataVector & data () const
 Return the data vector for analysis or external vtk output. More...
 
void writeVtk (const std::string &vtkName, const std::string &dataName="data") const
 Write the data to a vtk file. More...
 

Member Enumeration Documentation

◆ FieldType

template<class GridView , class Scalar >
enum Dumux::GstatRandomField::FieldType
Enumerator
scalar 
log10 

Constructor & Destructor Documentation

◆ GstatRandomField()

template<class GridView , class Scalar >
Dumux::GstatRandomField< GridView, Scalar >::GstatRandomField ( const GridView &  gridView,
const ElementMapper &  elementMapper 
)
inline
Parameters
gridViewthe used gridView
elementMapperMaps elements of the given grid view

Member Function Documentation

◆ create()

template<class GridView , class Scalar >
void Dumux::GstatRandomField< GridView, Scalar >::create ( const std::string &  gstatControlFile,
const std::string &  gstatInputFile = "gstatInput.txt",
const std::string &  gstatOutputFile = "permeab.dat",
FieldType  fieldType = FieldType::scalar,
bool  createNew = true 
)
inline

A gstatControlFile in which all commands and in/output files for gstat are specified. A gstatInputFile contains all coordinates (cell centers) of the grid, so that gstat can perform its random realization. The filename must be same as in the gstatControlFile. A gstatOutputFile in which gstat writes the random values to this file. The filename must be the same as in the gstatControlFile.

Parameters
fieldType
gstatControlFilename of control file for gstat
gstatInputFilename of input file for gstat
gstatOutputFilename of the gstat output file
createNewset true to create a new field

◆ data() [1/2]

template<class GridView , class Scalar >
const DataVector & Dumux::GstatRandomField< GridView, Scalar >::data ( ) const
inline

◆ data() [2/2]

template<class GridView , class Scalar >
Scalar Dumux::GstatRandomField< GridView, Scalar >::data ( const Element &  e) const
inline

◆ writeVtk()

template<class GridView , class Scalar >
void Dumux::GstatRandomField< GridView, Scalar >::writeVtk ( const std::string &  vtkName,
const std::string &  dataName = "data" 
) const
inline

The documentation for this class was generated from the following file: