container#
- class MultiComponentContainer(init, val=0.0)[source]#
Bases:
objectDatatype with multiple components, each one an object of its own.
This is the counterpart of
MultiComponentMeshMixinfor backends whose data cannot simply grow an axis: a FEniCSFunctionlives on aFunctionSpaceand a PETScVecon aDMDA, so the components cannot be views into one contiguous array and have to be separate objects instead.To make a specific multi-component datatype, derive from this class, list the components as strings in
components, and say what a single component is incomponent_type. An example:class rhs_fenics_mesh(MultiComponentContainer): components = ['impl', 'expl'] component_type = fenics_mesh
Instantiating such a datatype builds one component of
component_typeper name, either by copying the components of another instance or by passinginitandvalon to each of them. The arithmetic is applied component by component, so the component type is what decides which operands it accepts.- component_type = None#
- components = []#