Language Modelling (pystencilssfg.lang)

Expressions

class pystencilssfg.lang.expressions.IFieldExtraction

Interface for objects defining how to extract low-level field parameters from high-level data structures.

class pystencilssfg.lang.expressions.SrcField(dtype=None)

Represents a C++ data structure that can be mapped to a pystencils field.

Parameters:

dtype (PsType | None) –

class pystencilssfg.lang.expressions.SrcVector(dtype=None)

Represents a C++ data structure that represents a mathematical vector.

Parameters:

dtype (PsType | None) –

C++ Standard Library (pystencilssfg.lang.cpp)

Quick Access

pystencilssfg.lang.cpp.std.span(field)

Create an std::span reference for a 1D pystencils field

Parameters:

field (Field) –

pystencilssfg.lang.cpp.std.mdspan(field, extents_type=PsIntegerType(width=64, signed=False, const=False))

Create an std::mdspan reference for a pystencils field

Parameters:
  • field (Field) –

  • extents_type (PsType) –

pystencilssfg.lang.cpp.std.vector(field)

Create an std::vector reference for a 1D pystencils field

Parameters:

field (Field) –

Implementation

class pystencilssfg.lang.cpp.StdMdspan(T, extents, extents_type=PsIntegerType(width=64, signed=True, const=False), reference=False)
Parameters:
  • T (PsType) –

  • extents (tuple[int | str, ...]) –

  • extents_type (PsType) –

  • reference (bool) –

pystencilssfg.lang.cpp.mdspan_ref(field, extents_type=PsIntegerType(width=64, signed=False, const=False))

Creates a std::mdspan & for a given pystencils field.

Parameters:
  • field (Field) –

  • extents_type (PsType) –

class pystencilssfg.lang.cpp.StdVector(T, unsafe=False, reference=True)
Parameters:
  • T (PsType) –

  • unsafe (bool) –

  • reference (bool) –

class pystencilssfg.lang.cpp.StdTuple(element_types, const=False, ref=False)
Parameters:
class pystencilssfg.lang.cpp.StdSpan(T, ref=True, const=False)
Parameters:

T (PsCustomType | PsType) –