OOF2: The Manual
Name
conjugatePair — Establish conjugacy relations
Synopsis
from oof2.SWIG.engine.conjugate import conjugatePair
conjugatePair(name, equation, eqncomp, field, fieldcomp) Parameters
name-
nameis thePropertyTypeof thePropertythat this conjugacy relation applies to. equation-
equationis theEquationobject to which the conjugacy relationship applies. eqncomp-
eqncompindicates which components of theequationthe relation applies to. It is either a singleFieldIndexobject or an iterable container ofFieldIndexobjects. For example, it could be a list ofFieldIndexes, or theComponentsobject returned byEquation.components(). field-
fieldis theFieldobject to which the conjugacy relationship applies. fieldcomp-
fieldcompindicates which components offieldthe relation applies to. It is either a singleFieldIndexobject or an iterable container ofFieldIndexobjects.fieldcompmust represent the same number of components aseqncomp. EachFieldcomponent infieldcompis conjugate to theEquationcomponent in the same location ineqncomp.
Description
conjugatePair establishes conjugacy
relationships between Fields and Equations, allowing
symmetric finite element stiffness matrices to be constructed.
See Section 8.5 for an
overview.
conjugatePair is only available in
Python.
It is permissable, and even encouraged, to use Equation.components()
and Field.components()
for the eqncomp and
fieldcomp arguments. In most cases this
can be done simply. For example, in
SRC/engine/problem.py the Force_Balance equation and Displacement field are made conjugate like
this:
ForceBalanceEquation = equation.DivergenceEquation('Force_Balance', Stress, 2)
Displacement = field.TwoVectorField('Displacement')
conjugatePair("Elasticity",
ForceBalanceEquation,
ForceBalanceEquation.components(),
Displacement,
Displacement.components())
Caution is required, however, because the order in which
indices are returned by Field.components() might
not match the order in which they're returned by
Equation.components(). Consider the Plane_Stress equation:
ForcesOutOfPlane = equation.PlaneFluxEquation('Plane_Stress', Stress, 3)
The components of a PlaneFluxEquation
are the out-of-plane components of its Flux, which in this
case is a SymmetricTensorFlux.
The ComponentIterator for the tensor flux returns components
in Voigt order:
>>> list(Stress.components(OUT_OF_PLANE)) [SymTensorIndex(2,2), SymTensorIndex(1,2), SymTensorIndex(0,2)]
which are Voigt indices 2, 3, and 4. The Field that is
conjugate to the out-of-plane parts of the Stress is the out-of-plane part of
the Displacement, Displacement.out_of_plane(),
composed of the x,
y, and z derivatives
of the z component of the Displacement. This is a ThreeVectorField,
and its components are simple vector field indices 0, 1, and
2:
>>> list(Displacement.out_of_plane().components()) [VectorFieldIndex(0), VectorFieldIndex(1), VectorFieldIndex(2)]
The equation for the zz (ie, 22)
component of the Stress should be
conjugate to the z (ie, 2) component of
the Displacement derivatives. But
invoking conjugatePair naively, like
this:
conjugatePair("Elasticity",
ForcesOutOfPlane,
ForcesOutOfPlane.components(),
Displacement.out_of_plane(),
Displacement.out_of_plane().components())
will associate Equation component
SymTensoorIndex(2,2) (ie,
zz) with Field component
VectorFieldIndex(0) (ie, x),
because those are the first components returned by the
iterators. It will similarly pair
SymTensorIndex(0,2) with
VectorFieldIndex(2). To get the correct
conjugacy relations, it's necessary to reverse the order of
one of the sets of components:
conjugatePair("Elasticity",
ForcesOutOfPlane,
ForcesOutOfPlane.components(),
Displacement.out_of_plane(),
reversed(list(Displacement.out_of_plane().components())))



