version 0.4
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 Basis , class... options>
void Ikarus::Python::registerBasis (pybind11::handle scope, pybind11::class_< Basis, 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 KirchhoffLoveShell , class... options>
void Ikarus::Python::registerKirchhoffLoveShell (pybind11::handle scope, pybind11::class_< KirchhoffLoveShell, options... > cls)
 Register Python bindings for a KirchhoffLoveShell class. More...
 
template<class LinearElastic , class... options>
void Ikarus::Python::registerLinearElastic (pybind11::handle scope, pybind11::class_< LinearElastic, options... > cls)
 Register Python bindings for a Linear Elastic class. More...
 
template<bool defaultInitializers = true, class FE , class... options>
void Ikarus::Python::registerElement (pybind11::handle scope, pybind11::class_< FE, options... > cls)
 Register Python bindings for a generic finite element class. More...
 

Detailed Description

Function Documentation

◆ registerBasis()

template<class Basis , class... options>
void Ikarus::Python::registerBasis ( pybind11::handle  scope,
pybind11::class_< Basis, options... >  cls 
)
Template Parameters
BasisThe Ikarus 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 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.

◆ registerElement()

template<bool defaultInitializers = true, class FE , class... options>
void Ikarus::Python::registerElement ( pybind11::handle  scope,
pybind11::class_< FE, options... >  cls 
)

This function registers Python bindings for a generic finite element class, allowing it to be used in Python scripts. The registered class will have multiple initializers with different sets of parameters and member functions to calculate results and access properties.

Template Parameters
defaultInitializersIf true, include default initializers for the finite element class.
FEThe generic finite element 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 finite element class.
Here is the caller graph for this function:

◆ registerKirchhoffLoveShell()

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

This function registers Python bindings for a KirchhoffLoveShell class, allowing it to be used in Python scripts. The registered class will have several initializers with different sets of parameters.

Template Parameters
KirchhoffLoveShellThe KirchhoffLoveShell 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.

◆ registerLinearElastic()

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

This function registers Python bindings for a LinearElastic class, allowing it to be used in Python scripts. The registered class will have several initializers with different sets of parameters.

Template Parameters
LinearElasticThe LinearElastic 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 LinearElastic 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. <>