KASKADE 7 development version
|
Reader for Amira meshes. More...
Namespaces | |
namespace | ImplementationDetails |
Functions | |
template<class Grid , class Scalar , class ScalarEd = Scalar> | |
std::unique_ptr< Grid > | readGrid (std::string const &gridfile, int initialGridSize=0, std::vector< int > *boundaryIds=nullptr, std::vector< Dune::FieldVector< ScalarEd, Grid::dimension > > *edgeDisplacement=nullptr, double scale=1.0) |
function reading an Amira mesh file in ASCII format. More... | |
template<class Grid , class Scalar , class ScalarEd = Scalar, class Deformation > | |
std::unique_ptr< Grid > | readGrid (std::string const &gridfile, Deformation const &deformation, int initialGridSize=0, std::vector< int > *boundaryIds=nullptr, std::vector< Dune::FieldVector< ScalarEd, Grid::dimension > > *edgeDisplacement=nullptr, double scale=1.0) |
function reading an Amira mesh file in ASCII format. More... | |
template<class Grid , class Scalar , class ScalarEd = Scalar> | |
std::unique_ptr< Grid > | mergeGrids (std::string const &gridfile1, std::string const &gridfile2, int initialGridSize=0, std::vector< int > *boundaryIds=nullptr, double scale1=1.0, double scale2=1.0) |
function joining two Amira mesh files in ASCII format into one grid. More... | |
template<class DataType , class FunctionSpaceElement > | |
void | readData (std::string const &datafile, std::string const &dataname, std::string const &componentname, FunctionSpaceElement &data, bool verbose=false) |
function reading additional data from an Amira mesh file in ASCII format. More... | |
template<class Scalar , int numberOfComponents> | |
void | readData (std::string const &datafile, std::string const &dataname, std::string const &componentname, std::vector< Dune::FieldVector< Scalar, numberOfComponents > > &data) |
function reading additional data for each vertex from an Amira mesh file in ASCII format. More... | |
template<class VarSetDesc > | |
void | readDeformationIntoVariableSetRepresentation (std::string const &gridfile, std::string const &datafile, typename VarSetDesc::VariableSet &data) |
function reading return a FE-function describing the deformation. More... | |
template<class FunctionSpaceElement , class FileScalar = float> | |
void | readDeformation (std::string const &gridfile, std::string const &datafile, FunctionSpaceElement &data) |
function reading return a fe-function describing the deformation. More... | |
template<class GridView , class FunctionSpaceElement , class FileScalar = float> | |
void | readDeformation2 (GridView const &gridView, std::string const &datafile, FunctionSpaceElement &data) |
template<class Grid > | |
void | boundaryConditionsToScalarField (std::string const &gridfile, std::string const &savefilename=std::string("boundaryConditions"), int initialGridSize=0) |
Read boundary indices and save as scalar field in .vtu-file. More... | |
Reader for Amira meshes.
Note that the Amira mesh file must be in ASCII format. (I think this is not true, can also read binary Amira mesh, but only Big Endian.) Currently UG and ALUSimplex grids are supported.
void Kaskade::AmiraMeshReader::boundaryConditionsToScalarField | ( | std::string const & | gridfile, |
std::string const & | savefilename = std::string("boundaryConditions") , |
||
int | initialGridSize = 0 |
||
) |
Read boundary indices and save as scalar field in .vtu-file.
gridfile | name of the Amira mesh file |
savefilename | name of the output file (optional), default: "boundaryConditions.vtu" |
initialGridSize | initial grid size in mb(only for UGGrid) |
Definition at line 936 of file amirameshreader.hh.
std::unique_ptr< Grid > Kaskade::AmiraMeshReader::mergeGrids | ( | std::string const & | gridfile1, |
std::string const & | gridfile2, | ||
int | initialGridSize = 0 , |
||
std::vector< int > * | boundaryIds = nullptr , |
||
double | scale1 = 1.0 , |
||
double | scale2 = 1.0 |
||
) |
function joining two Amira mesh files in ASCII format into one grid.
This function reads vertices, tetrahedra and, if defined, boundary triangles of each of two Amira mesh files. After renumbering the two are joined into one grid.
Grid | the type of grid to be constructed |
Scalar | scalar type of the vertex coordinates, i.e. how it is specified in the amira file, it is important to choose it correctly |
gridfile1 | the name of the first Amira mesh file |
gridfile2 | the name of the second Amira mesh file |
initialGridSize | optional parameter for reserving memory for the grid |
boundaryIds | if ids (e.g. membership to patches) for boundary segments are specified in the grid file, and this pointer is not null, then on return the pointed to vector will contain for each boundary segment (by its index, see Dune::Intersection) the corresponding id |
edgeDisplacement | if edges (by node indices) and their positions (of midpoints) are specified in the grid file and this pointer is not null, then on return the pointed to vector will contain for each edge (by its global index in the returned grid) the corresponding displacement |
scale | a factor with which the geometry is scaled. Use this to convert the geometry to standard SI units if it is given in the grid file in a different scale (e.g., millimeter). This is overwritten if the grid file contains a UnitLength parameter. |
Definition at line 467 of file amirameshreader.hh.
void Kaskade::AmiraMeshReader::readData | ( | std::string const & | datafile, |
std::string const & | dataname, | ||
std::string const & | componentname, | ||
FunctionSpaceElement & | data, | ||
bool | verbose = false |
||
) |
function reading additional data from an Amira mesh file in ASCII format.
DataType | scalar type of the data in the Amira mesh file (e.g., unsigned char) |
FunctionSpaceElement | type of FE-Function to store the additional data in |
datafile | the name of the Amira mesh file containing additional data |
dataname | the location of the data in the Amira mesh file (e.g., "Tetrahedra") |
componentname | the name of the data's components in the Amira mesh file (e.g., "Materials") |
data | FE function object for storing the additional data |
Definition at line 678 of file amirameshreader.hh.
void Kaskade::AmiraMeshReader::readData | ( | std::string const & | datafile, |
std::string const & | dataname, | ||
std::string const & | componentname, | ||
std::vector< Dune::FieldVector< Scalar, numberOfComponents > > & | data | ||
) |
function reading additional data for each vertex from an Amira mesh file in ASCII format.
Scalar | scalar type of the data in the Amira mesh file |
numberOfComponents | number of components of each entry of the data |
datafile | the name of the Amira mesh file containing additional node data |
dataname | the location of the data in the Amira mesh file (e.g., "Tetrahedra") |
componentname | the name of the data's components in the Amira mesh file (e.g., "Materials") |
data | vector containing the data |
Definition at line 727 of file amirameshreader.hh.
void Kaskade::AmiraMeshReader::readDeformation | ( | std::string const & | gridfile, |
std::string const & | datafile, | ||
FunctionSpaceElement & | data | ||
) |
function reading return a fe-function describing the deformation.
Function reading a deformed and a undeformed geometry from Amira mesh files in ASCII format. These geometry must possess the same number of nodes. For each vertex the difference between the geometries is calculated. This difference is read into the fe-function object data.
datafile | the name of the Amira mesh file containing the deformed geometry |
gridfile | the name of the Amira mesh file containing the undeformed geometry |
data | fe-function object for storing the deformation |
Definition at line 829 of file amirameshreader.hh.
void Kaskade::AmiraMeshReader::readDeformation2 | ( | GridView const & | gridView, |
std::string const & | datafile, | ||
FunctionSpaceElement & | data | ||
) |
Definition at line 884 of file amirameshreader.hh.
void Kaskade::AmiraMeshReader::readDeformationIntoVariableSetRepresentation | ( | std::string const & | gridfile, |
std::string const & | datafile, | ||
typename VarSetDesc::VariableSet & | data | ||
) |
function reading return a FE-function describing the deformation.
Function reading a deformed and an undeformed geometry from Amira mesh files in ASCII format. These geometries must possess the same number of nodes. For each vertex the difference between the geometries is calculated. This difference is stored into the FE-function at index 0 of the variable set data.
datafile | the name of the Amira mesh file containing the deformed geometry |
gridfile | the name of the Amira mesh file containing the undeformed geometry |
data | fe-function object for storing the deformation of type VariableSet::VariableSet |
Definition at line 761 of file amirameshreader.hh.
std::unique_ptr< Grid > Kaskade::AmiraMeshReader::readGrid | ( | std::string const & | gridfile, |
Deformation const & | deformation, | ||
int | initialGridSize = 0 , |
||
std::vector< int > * | boundaryIds = nullptr , |
||
std::vector< Dune::FieldVector< ScalarEd, Grid::dimension > > * | edgeDisplacement = nullptr , |
||
double | scale = 1.0 |
||
) |
function reading an Amira mesh file in ASCII format.
This function reads vertices, tetrahedra and, if defined, boundary triangles of an Amira mesh file into a grid and returns this grid.
Grid | the type of grid to be constructed |
Scalar | scalar type of the vertex coordinates, i.e. how it is specified in the amira file, it is important to choose it correctly |
gridfile | the name of the Amira mesh file |
deformation | performs a deformation/transformation to each vertex of the mesh to be read (typically a lambda function) |
initialGridSize | optional parameter for reserving memory for the grid |
boundaryIds | if ids (e.g. membership to patches) for boundary segments are specified in the grid file, and this pointer is not null, then on return the pointed to vector will contain for each boundary segment (by its index, see Dune::Intersection) the corresponding id |
edgeDisplacement | if edges (by node indices) and their positions (of midpoints) are specified in the grid file and this pointer is not null, then on return the pointed to vector will contain for each edge (by its global index in the returned grid) the corresponding displacement |
scale | a factor with which the geometry is scaled. Use this to convert the geometry to standard SI units if it is given in the grid file in a different scale (e.g., millimeter). This is overwritten if the grid file contains a UnitLength parameter. |
Definition at line 296 of file amirameshreader.hh.
std::unique_ptr< Grid > Kaskade::AmiraMeshReader::readGrid | ( | std::string const & | gridfile, |
int | initialGridSize = 0 , |
||
std::vector< int > * | boundaryIds = nullptr , |
||
std::vector< Dune::FieldVector< ScalarEd, Grid::dimension > > * | edgeDisplacement = nullptr , |
||
double | scale = 1.0 |
||
) |
function reading an Amira mesh file in ASCII format.
This function reads vertices, tetrahedra and, if defined, boundary triangles of an Amira mesh file into a grid and returns this grid.
Grid | the type of grid to be constructed |
Scalar | scalar type of the vertex coordinates, i.e. how it is specified in the amira file, it is important to choose it correctly |
gridfile | the name of the Amira mesh file |
initialGridSize | optional parameter for reserving memory for the grid |
boundaryIds | if ids (e.g. membership to patches) for boundary segments are specified in the grid file, and this pointer is not null, then on return the pointed to vector will contain for each boundary segment (by its index, see Dune::Intersection) the corresponding id |
edgeDisplacement | if edges (by node indices) and their positions (of midpoints) are specified in the grid file and this pointer is not null, then on return the pointed to vector will contain for each edge (by its global index in the returned grid) the corresponding displacement |
scale | a factor with which the geometry is scaled. Use this to convert the geometry to standard SI units if it is given in the grid file in a different scale (e.g., millimeter). This is overwritten if the grid file contains a UnitLength parameter. |
Definition at line 261 of file amirameshreader.hh.