sfepy.fem.conditions module

The Dirichlet, periodic and linear combination boundary condition classes, as well as the initial condition class.

class sfepy.fem.conditions.Condition(name, **kwargs)[source]

Common boundary condition methods.

canonize_dof_names(dofs)[source]

Canonize the DOF names using the full list of DOFs of a variable.

Assumes single condition instance.

iter_single()[source]

Create a single condition instance for each item in self.dofs and yield it.

class sfepy.fem.conditions.Conditions(objs=None, **kwargs)[source]

Container for various conditions.

canonize_dof_names(dofs)[source]

Canonize the DOF names using the full list of DOFs of a variable.

static from_conf(conf, regions)[source]
group_by_variables(groups=None)[source]

Group boundary conditions of each variable. Each condition is a group is a single condition.

Parameters:

groups : dict, optional

If present, update the groups dictionary.

Returns:

out : dict

The dictionary with variable names as keys and lists of single condition instances as values.

sort()[source]

Sort boundary conditions by their key.

zero_dofs()[source]

Set all boundary condition values to zero, if applicable.

class sfepy.fem.conditions.EssentialBC(name, region, dofs, key='', times=None)[source]

Essential boundary condidion.

Parameters:

name : str

The boundary condition name.

region : Region instance

The region where the boundary condition is applied.

dofs : dict

The boundary condition specification defining the constrained DOFs and their values.

key : str, optional

The sorting key.

times : list or str, optional

The list of time intervals or a function returning True at time steps, when the condition applies.

zero_dofs()[source]

Set all essential boundary condition values to zero.

class sfepy.fem.conditions.InitialCondition(name, region, dofs, key='')[source]

Initial condidion.

Parameters:

name : str

The initial condition name.

region : Region instance

The region where the initial condition is applied.

dofs : dict

The initial condition specification defining the constrained DOFs and their values.

key : str, optional

The sorting key.

class sfepy.fem.conditions.LinearCombinationBC(name, region, dofs, key='', times=None, filename=None)[source]

Linear combination boundary condidion.

Parameters:

name : str

The boundary condition name.

region : Region instance

The region where the boundary condition is applied.

dofs : dict

The boundary condition specification defining the constrained DOFs and the constraint type.

key : str, optional

The sorting key.

times : list or str, optional

The list of time intervals or a function returning True at time steps, when the condition applies.

filename : str, optional

Some conditions can store data (e.g. normal vectors) into a file.

class sfepy.fem.conditions.PeriodicBC(name, regions, dofs, match, key='', times=None)[source]

Periodic boundary condidion.

Parameters:

name : str

The boundary condition name.

regions : list of two Region instances

The master region and the slave region where the DOFs should match.

dofs : dict

The boundary condition specification defining the DOFs in the master region and the corresponding DOFs in the slave region.

match : str

The name of function for matching corresponding nodes in the two regions.

key : str, optional

The sorting key.

times : list or str, optional

The list of time intervals or a function returning True at time steps, when the condition applies.

canonize_dof_names(dofs)[source]

Canonize the DOF names using the full list of DOFs of a variable.

Assumes single condition instance.