BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Static Public Member Functions | List of all members
Bempp::GridFactory Class Reference

Grid factory. More...

#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/grid/grid_factory.hpp>

Static Public Member Functions

static shared_ptr< GridcreateStructuredGrid (const GridParameters &params, const arma::Col< double > &lowerLeft, const arma::Col< double > &upperRight, const arma::Col< unsigned int > &nElements)
 Construct a regular structured grid. More...
 
static shared_ptr< GridimportGmshGrid (const GridParameters &params, const std::string &fileName, bool verbose=false, bool insertBoundarySegments=false)
 Import grid from a file in Gmsh format. More...
 
static shared_ptr< GridimportGmshGrid (const GridParameters &params, const std::string &fileName, std::vector< int > &boundaryId2PhysicalEntity, std::vector< int > &elementIndex2PhysicalEntity, bool verbose=true, bool insertBoundarySegments=false)
 Import grid from a file in Gmsh format. More...
 
static shared_ptr< GridcreateGridFromConnectivityArrays (const GridParameters &params, const arma::Mat< double > &vertices, const arma::Mat< int > &elementCorners, const std::vector< int > &domainIndices=std::vector< int >())
 Create a grid from connectivity arrays. More...
 

Detailed Description

Grid factory.

This class provides static member functions to construct grids on the fly and to import grids from existing files.

Member Function Documentation

shared_ptr< Grid > Bempp::GridFactory::createGridFromConnectivityArrays ( const GridParameters params,
const arma::Mat< double > &  vertices,
const arma::Mat< int > &  elementCorners,
const std::vector< int > &  domainIndices = std::vector<int>() 
)
static

Create a grid from connectivity arrays.

Parameters
[in]paramsParameters of the grid to be constructed.
[in]vertices2D array whose (i, j)th element contains the ith component of the jth vertex.
[in]elementCorners2D array whose (i, j)th element contains the index of the ith vertex of the jth element.
[in]domainIndices(Optional) Vector whose ith element contains the domain index of the ith element. By default, this argument is set to an empty vector, in which case all elements are taken to belong to domain 0.
Note
Currently only grids with triangular topology are supported.

References Bempp::toString(), and Bempp::GridParameters::TRIANGULAR.

shared_ptr< Grid > Bempp::GridFactory::createStructuredGrid ( const GridParameters params,
const arma::Col< double > &  lowerLeft,
const arma::Col< double > &  upperRight,
const arma::Col< unsigned int > &  nElements 
)
static

Construct a regular structured grid.

Parameters
[in]paramsParameters of the grid to be constructed.
[in]lowerLeftCoordinates of the lower left corner of the grid.
[in]upperRightCoordinates of the upper right corner of the grid.
[in]nElementsNumber of grid subdivisions in each direction.

This function constructs a regular structured grid. Its dimension, dimGrid, and the dimension of the surrounding space, dimWorld, are determined from the parameter params. The constructed grid covers the dimGrid-dimensional cube

[lowerLeft(0) upperRight(0)] x [lowerLeft(1) upperRight(1)] x ... x [lowerLeft(dimGrid-1), upperRight(dimGrid-1)].

The last dimWorld - dimGrid dimensions of all grid points are set to zero.

Each side of the cube parallel to the nth coordinate axis is subdivided into nElements(n) segments.

Note
Currently only grids with triangular topology are supported.

References Dune::BemppStructuredGridFactory< GridType >::createSimplexGrid(), and Bempp::GridParameters::TRIANGULAR.

shared_ptr< Grid > Bempp::GridFactory::importGmshGrid ( const GridParameters params,
const std::string &  fileName,
bool  verbose = false,
bool  insertBoundarySegments = false 
)
static

Import grid from a file in Gmsh format.

Parameters
[in]paramsParameters of the grid to be constructed.
[in]fileNameName of the Gmsh file.
[in]verboseOutput diagnostic information.
[in]insertBoundarySegments
Bug:
Ask Dune developers about the significance of insertBoundarySegments.
See Also
http://geuz.org/gmsh/ for information about the Gmsh file format.
Dune::GmshReader documentation for information about the supported Gmsh features.

References Bempp::GridParameters::TETRAHEDRAL, and Bempp::GridParameters::TRIANGULAR.

shared_ptr< Grid > Bempp::GridFactory::importGmshGrid ( const GridParameters params,
const std::string &  fileName,
std::vector< int > &  boundaryId2PhysicalEntity,
std::vector< int > &  elementIndex2PhysicalEntity,
bool  verbose = true,
bool  insertBoundarySegments = false 
)
static

Import grid from a file in Gmsh format.

Parameters
[in]paramsParameters of the grid to be constructed.
[in]fileNameName of the Gmsh file.
[in]boundaryId2PhysicalEntity
[in]elementIndex2PhysicalEntity
[in]verboseOutput diagnostic information.
[in]insertBoundarySegments
Bug:
Ask Dune developers about the significance of the undocumented parameters.
See Also
http://geuz.org/gmsh/ for information about the Gmsh file format.
Dune::GmshReader documentation for information about the supported Gmsh features.

References Bempp::GridParameters::TETRAHEDRAL, and Bempp::GridParameters::TRIANGULAR.


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