fluidsimfoam.foam_input_files.fields#

Helper to create field files

Functions

create_array_from_bin_data(bin_data, ...)

create_field_from_code(code)

get_arch(header)

Get architecture info

read_field_file(path[, skip_boundary_field])

Classes

FieldABC(name, dimension[, tree, values])

VolScalarField(name, dimension[, tree, values])

VolTensorField(name, dimension[, tree, values])

VolVectorField(name, dimension[, tree, values])

fluidsimfoam.foam_input_files.fields.get_arch(header: dict)[source]#

Get architecture info

From OpenFOAM documentation: “The arch specification indicates the machine endian (LSB|MSB), the label width (32|64) and the scalar precision (32|64).”

fluidsimfoam.foam_input_files.fields.create_array_from_bin_data(bin_data: bytes, cls_name: str, endianess: str, nb_elems: int, scalar_precision: int)[source]#
class fluidsimfoam.foam_input_files.fields.FieldABC(name, dimension, tree=None, values=None)[source]#
cls_name: str#
classmethod from_code(code: Union[bytes, str], skip_boundary_field=False, header=None)[source]#
classmethod from_path(path: str, skip_boundary_field=False, header=None)[source]#
dump()[source]#
overwrite()[source]#
abstract set_values(values)[source]#

Set internalField with value(s)

set_codestream(code, include='#include "fvCFD.H"', options='-I$(LIB_SRC)/finiteVolume/lnInclude \\\n-I$(LIB_SRC)/meshTools/lnInclude', libs='-lmeshTools \\\n-lfiniteVolume')[source]#
set_boundary(name, type_, value=None, gradient=None)[source]#
set_name(name)[source]#
get_array()[source]#
class fluidsimfoam.foam_input_files.fields.VolScalarField(name, dimension, tree=None, values=None)[source]#
cls_name: str = 'volScalarField'#
set_values(values)[source]#

Set internalField with value(s)

class fluidsimfoam.foam_input_files.fields.VolVectorField(name, dimension, tree=None, values=None)[source]#
cls_name: str = 'volVectorField'#
set_values(values, vy=None, vz=None)[source]#

Set internalField with value(s)

get_components()[source]#
class fluidsimfoam.foam_input_files.fields.VolTensorField(name, dimension, tree=None, values=None)[source]#
cls_name: str = 'volTensorField'#
set_values(values)[source]#

Set internalField with value(s)

fluidsimfoam.foam_input_files.fields.read_field_file(path, skip_boundary_field=True)[source]#
fluidsimfoam.foam_input_files.fields.create_field_from_code(code)[source]#