sfepy.discrete.common.dof_info module¶
Classes holding information on global DOFs and mapping of all DOFs - equations (active DOFs).
Helper functions for the equation mapping.
- class sfepy.discrete.common.dof_info.DofInfo(name)[source]¶
Global DOF information, i.e. ordering of DOFs of the state (unknown) variables in the global state vector.
- append_raw(name, n_dof)[source]¶
Append raw DOFs.
- Parameters:
- namestr
The name of variable the DOFs correspond to.
- n_dofint
The number of DOFs.
- append_variable(var, active=False, shared=None)[source]¶
Append DOFs of the given variable.
- Parameters:
- varVariable instance
The variable to append.
- activebool, optional
When True, only active (non-constrained) DOFs are considered.
- class sfepy.discrete.common.dof_info.EquationMap(name, dof_names, var_di)[source]¶
Map all DOFs to equations for active DOFs.
- get_operator()[source]¶
Get the matrix operator corresponding to the equation mapping, such that the restricted matrix can be obtained from the full matrix by . All the matrices are w.r.t. a single variables that uses this mapping.
- Returns:
- mtxcoo_matrix
The matrix .
- map_equations(bcs, field, ts, functions, problem=None, warn=False)[source]¶
Create the mapping of active DOFs from/to all DOFs.
- Parameters:
- bcsConditions instance
The Dirichlet or periodic boundary conditions (single condition instances). The dof names in the conditions must already be canonized.
- fieldField instance
The field of the variable holding the DOFs.
- tsTimeStepper instance
The time stepper.
- functionsFunctions instance
The registered functions.
- problemProblem instance, optional
The problem that can be passed to user functions as a context.
- warnbool, optional
If True, warn about BC on non-existent nodes.
- Returns:
- active_bcsset
The set of boundary conditions active in the current time.
Notes
Periodic bc: master and slave DOFs must belong to the same field (variables can differ, though).
- sfepy.discrete.common.dof_info.expand_nodes_to_dofs(nods, n_dof_per_node)[source]¶
Expand DOF node indices into DOFs given a constant number of DOFs per node.
- sfepy.discrete.common.dof_info.expand_nodes_to_equations(nods, dof_names, all_dof_names)[source]¶
Expand vector of node indices to equations (DOF indices) based on the DOF-per-node count.
DOF names must be already canonized.
- Returns:
- eqarray
The equations/DOF indices in the node-by-node order.