version 0.4.1
Python bindings

Header for Python Bindings. More...

Collaboration diagram for Python bindings:

Functions

template<class Assembler , class... options>
void Ikarus::Python::registerSparseFlatAssembler (pybind11::handle scope, pybind11::class_< Assembler, options... > cls)
 Register Python bindings for a SparseFlatAssembler class.
. More...
 
template<class Assembler , class... options>
void Ikarus::Python::registerDenseFlatAssembler (pybind11::handle scope, pybind11::class_< Assembler, options... > cls)
 Register Python bindings for a DenseFlatAssembler class.
. More...
 
template<class BasisHandler , class... options>
void Ikarus::Python::registerBasisHandler (pybind11::handle scope, pybind11::class_< BasisHandler, options... > cls)
 Register a Python wrapper for an Ikarus basis class. More...
 
template<class DirichletValues , class... options>
void Ikarus::Python::registerDirichletValues (pybind11::handle scope, pybind11::class_< DirichletValues, options... > cls)
 Register Python bindings for a DirichletValues class. More...
 
template<class FE , class... options>
void Ikarus::Python::registerFE (pybind11::handle scope, pybind11::class_< FE, options... > cls)
 Register Python bindings for the FE class. More...
 

Detailed Description

Function Documentation

◆ registerBasisHandler()

template<class BasisHandler , class... options>
void Ikarus::Python::registerBasisHandler ( pybind11::handle  scope,
pybind11::class_< BasisHandler, options... >  cls 
)
Template Parameters
BasisHandlerThe Ikarus handler basis class to be registered.
optionsVariadic template parameters for additional options when defining the Python class.
Parameters
scopeA Pybind11 handle representing the Python scope where the class should be registered.
clsThe Pybind11 class template to be used for registering the Ikarus basis handler class.

◆ registerDenseFlatAssembler()

template<class Assembler , class... options>
void Ikarus::Python::registerDenseFlatAssembler ( pybind11::handle  scope,
pybind11::class_< Assembler, options... >  cls 
)

This function registers Python bindings for a DenseFlatAssembler class, allowing it to be used in Python scripts.
This function is a result of the macro MAKE_ASSEMBLER_REGISTERY_FUNCTION( DenseFlatAssembler ).

The registered class will have an initializer that takes a list of finite elements (fes) and a DirichletValuesType object.
It exposes several member functions to Python:

  • getMatrix(req): Returns a dense matrix based on the specified FERequirementType.
  • getReducedMatrix(req): Returns a reduced dense matrix based on the specified FERequirementType.
  • getVector(req): Returns a vector based on the specified FERequirementType.
  • getScalar(req): Returns a scalar based on the specified FERequirementType.
  • getReducedVector(req): Returns a reduced vector based on the specified FERequirementType.
  • createFullVector(redVec): Creates a full vector from a reduced vector.
  • reducedSize(): Returns the size of the reduced space.


Template Parameters
AssemblerThe DenseFlatAssembler class to be registered.
optionsVariadic template parameters for additional options when defining the Python class.
Parameters
scopeA Pybind11 handle representing the Python scope where the class should be registered.
clsThe Pybind11 class template to be used for registering the DenseFlatAssembler class. <>

◆ registerDirichletValues()

template<class DirichletValues , class... options>
void Ikarus::Python::registerDirichletValues ( pybind11::handle  scope,
pybind11::class_< DirichletValues, options... >  cls 
)

This function registers Python bindings for a DirichletValues class, allowing it to be used in Python scripts. The registered class will have an initializer that takes a Basis object. It exposes several member functions to Python:

  • fixBoundaryDOFs(f): Fixes boundary degrees of freedom using a user-defined function f.
  • fixBoundaryDOFsUsingLocalView(f): Fixes boundary degrees of freedom using a user-defined function f with a LocalView argument.
  • fixBoundaryDOFsUsingLocalViewAndIntersection(f): Fixes boundary degrees of freedom using a user-defined function f with LocalView and Intersection arguments.
  • fixDOFs(f): Fixes boundary degrees of freedom using a user-defined function f with the boolean vector and the basis as arguments.
Template Parameters
DirichletValuesThe DirichletValues class to be registered.
optionsVariadic template parameters for additional options when defining the Python class.
Parameters
scopeA Pybind11 handle representing the Python scope where the class should be registered.
clsThe Pybind11 class template to be used for registering the DirichletValues class.

◆ registerFE()

template<class FE , class... options>
void Ikarus::Python::registerFE ( pybind11::handle  scope,
pybind11::class_< FE, options... >  cls 
)

This function registers Python bindings for a FE class, allowing it to be used in Python scripts.

Template Parameters
FEThe FE class to be registered.
optionsVariadic template parameters for additional options when defining the Python class.
Parameters
scopeA Pybind11 handle representing the Python scope where the class should be registered.
clsThe Pybind11 class template to be used for registering the KirchhoffLoveShell class.

◆ registerSparseFlatAssembler()

template<class Assembler , class... options>
void Ikarus::Python::registerSparseFlatAssembler ( pybind11::handle  scope,
pybind11::class_< Assembler, options... >  cls 
)

This function registers Python bindings for a SparseFlatAssembler class, allowing it to be used in Python scripts.
This function is a result of the macro MAKE_ASSEMBLER_REGISTERY_FUNCTION( SparseFlatAssembler ).

The registered class will have an initializer that takes a list of finite elements (fes) and a DirichletValuesType object.
It exposes several member functions to Python:

  • getMatrix(req): Returns a dense matrix based on the specified FERequirementType.
  • getReducedMatrix(req): Returns a reduced dense matrix based on the specified FERequirementType.
  • getVector(req): Returns a vector based on the specified FERequirementType.
  • getScalar(req): Returns a scalar based on the specified FERequirementType.
  • getReducedVector(req): Returns a reduced vector based on the specified FERequirementType.
  • createFullVector(redVec): Creates a full vector from a reduced vector.
  • reducedSize(): Returns the size of the reduced space.


Template Parameters
AssemblerThe SparseFlatAssembler class to be registered.
optionsVariadic template parameters for additional options when defining the Python class.
Parameters
scopeA Pybind11 handle representing the Python scope where the class should be registered.
clsThe Pybind11 class template to be used for registering the SparseFlatAssembler class. <>