Exemple #1
0
###############################################################
##
## Heat flux equation
##
## In-plane components, T
##
T = fieldindex.ScalarFieldIndex()
DivJ = fieldindex.ScalarFieldIndex()

conjugate.conjugatePair("ThermalConductivity", HeatBalanceEquation, DivJ,
                        Temperature, T)
## $\nabla \cdot \vec{J}$ is conjugate to T

## out-of-plane components, $\frac{\partial T}{\partial z}$
if config.dimension() == 2:
    T_z = fieldindex.OutOfPlaneVectorFieldIndex(2)
    J_z = fieldindex.OutOfPlaneVectorFieldIndex(2)

    conjugate.conjugatePair("ThermalConductivity", HeatOutOfPlane, J_z,
                            Temperature.out_of_plane(), T_z)
##  $J_{z}$ is conjugate to $\frac{\partial T}{\partial z}$

###############################################################
##
## Coulomb equation
##
## In-plane components, phi
##
phi = fieldindex.ScalarFieldIndex()
DivD = fieldindex.ScalarFieldIndex()
Exemple #2
0
from ooflib.engine import conjugate
from ooflib.SWIG.engine import fieldindex

# Field and Equation components are both specified by instances of
# FieldIndex classes.  A ScalarFieldIndex has only one value.  It's
# only purpose is to make it possible to treat scalar fields the same
# way as other more complicated fields.
fx = fieldindex.ScalarFieldIndex()

conjugate.conjugatePair(
    "Frivolous",                        # the property type
    JamEqn, fx,                         # the equation, and its component
    Strawberry, fx)                     # the field, and its component

fz = fieldindex.OutOfPlaneVectorFieldIndex(2)
conjugate.conjugatePair("Frivolous",
                        OutOfPlaneJam, fz,
                        Strawberry.out_of_plane(), fz)


# A material Property is what connects a Field to a Flux.  Properties
# are almost always defined in C++ code, but their Registrations are
# in Python.

# Load the module containing the Property subclass code.
import fruitSWIG.fruitproperty

from ooflib.common.IO import parameter
from ooflib.engine import propertyregistration
from ooflib.SWIG.engine import symmmatrix