carputils
Doxygen code documentation for the python framework controlling openCARP
Functions | Variables
bin.igb_to_vtkhdf Namespace Reference

Convert igb files to VTKHDF format. More...

Functions

def arg_parser ()
 Generate a standard argument parser for collection of common options. More...
 
def main (args)
 Execute functions and create vtkhdf file. More...
 
def check_args (args)
 Check given arguments in general. More...
 
np.ndarray read_pts (str file_path, bool skip_invalid=True)
 Read in points of the mesh. More...
 
np.ndarray read_elem (str file_path)
 Read in elements of the mesh. More...
 
def read_igb_in_chunks (str file_path, float max_memory_gigabytes)
 Read in igb data as chunks. More...
 
def create_vtkhdf (str file_path, str geometry, str topology, dict num_geom, int cell_type)
 Create vtkhdf file. More...
 
def write_vtkhdf (str file_path, np.ndarray data, dict num_geom, ts_next, int stride)
 Write vtkhdf file. More...
 

Variables

def parsed_args = arg_parser()
 

Detailed Description

Convert igb files to VTKHDF format.

Function Documentation

◆ arg_parser()

def bin.igb_to_vtkhdf.arg_parser ( )

Generate a standard argument parser for collection of common options.

Returns
argparse Parsed arguments.

◆ check_args()

def bin.igb_to_vtkhdf.check_args (   args)

Check given arguments in general.

Parameters
argsContains parsed arguments.
Exceptions
FileNotFoundErrorIf file to be read at the given path does not exist.
SystemExitIf file to be written already exists and can't be overwritten.

◆ create_vtkhdf()

def bin.igb_to_vtkhdf.create_vtkhdf ( str  file_path,
str  geometry,
str  topology,
dict  num_geom,
int  cell_type 
)

Create vtkhdf file.

Parameters
file_pathContains file path of the mesh.
geometryContains specified geometry of the mesh.
topologyContains specified topology of the mesh.
num_geomContains number of cells, points, connections and points per cell.
cell_typeContains specified cell type.

◆ main()

def bin.igb_to_vtkhdf.main (   args)

Execute functions and create vtkhdf file.

Parameters
argsContains parsed arguments as returned by the function arg_parser.

◆ read_elem()

np.ndarray bin.igb_to_vtkhdf.read_elem ( str  file_path)

Read in elements of the mesh.

Parameters
file_pathContains file path of the mesh.
Exceptions
ValueErrorIf elements are not triangles or tetrahedra.
Returns
np Contains array with all elements of the mesh.

◆ read_igb_in_chunks()

def bin.igb_to_vtkhdf.read_igb_in_chunks ( str  file_path,
float  max_memory_gigabytes 
)

Read in igb data as chunks.

Parameters
file_pathContains file path of the mesh.
max_memory_gigabytesContains maximum memory in gigabytes.
Returns
np Contains data seperated in chunks.

◆ read_pts()

np.ndarray bin.igb_to_vtkhdf.read_pts ( str  file_path,
bool  skip_invalid = True 
)

Read in points of the mesh.

Parameters
file_pathContains file path of the mesh. skip_invalid (bool, optional): Skips invalid files. Defaults to True.
Exceptions
ValueErrorIf file contains invalid lines.
Returns
np Contains array with all points of the mesh.

◆ write_vtkhdf()

def bin.igb_to_vtkhdf.write_vtkhdf ( str  file_path,
np.ndarray  data,
dict  num_geom,
  ts_next,
int  stride 
)

Write vtkhdf file.

Parameters
file_pathContains file path of the mesh.
dataContains data of a chunk.
num_geomContains number of cells, points, connections and points per cell.
ts_nextContains file part of a chuck to write.
strideContains stride in case time steps should be skipped.
Returns
Any Part of the file defined by chunck to be stored.

Variable Documentation

◆ parsed_args

def bin.igb_to_vtkhdf.parsed_args = arg_parser()