예제 #1
0
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# [email protected].

from ooflib.engine import problem
from ooflib.SWIG.engine import flux
from ooflib.SWIG.engine import equation
from ooflib.SWIG.engine import field
from ooflib.SWIG.engine import fieldindex
from ooflib.SWIG.common import config
from ooflib.engine import conjugate

# Define a field.  This creates an object named 'Concentration' in the
# OOF namespace.
Concentration = problem.advertise(field.ScalarField('Concentration'))
# Define a flux
Atom_Flux = problem.advertise(flux.VectorFlux('Atom_Flux'))
Charge_Flux = problem.advertise(flux.VectorFlux('Charge_Flux'))

# And equations
AtomBalanceEquation = problem.advertise(
    equation.DivergenceEquation('Atom_Eqn', Atom_Flux, 1))

ChargeBalanceEquation = problem.advertise(
    equation.DivergenceEquation('Charge_Eqn', Charge_Flux, 1))

if config.dimension() == 2:
    AtomOutOfPlane = problem.advertise(
        equation.PlaneFluxEquation('Plane_Atom_Flux', Atom_Flux, 1))
    ChargeOutOfPlane = problem.advertise(
예제 #2
0
# For more details, including a complete description of all of the
# classes that can be used in this file, see the "Extending OOF2"
# chapter of the OOF2 manual.

from ooflib.engine import problem
from ooflib.SWIG.engine import equation
from ooflib.SWIG.engine import field
from ooflib.SWIG.engine import flux

# Define a new Field.  The available field classes are ScalarField
# (for scalars like Temperature) and TwoVectorField (for vectors like
# Displacement.  The 'Two' in 'TwoVectorField' refers to the number of
# in-plane components.  When OOF gets a third dimension, all
# VectorFields will have three components.)

Strawberry = problem.advertise(field.ScalarField('Strawberry'))

# Define a new Flux.  The available classes are VectorFlux (eg,
# HeatFlux, ElectricCurrent) and SymmetricTensorFlux (eg Stress).

Jam = problem.advertise(flux.VectorFlux('Strawberry_Jam'))

# Define a new Divergence Equation.  The equation equates the
# divergence of a given flux with some external forcing terms.  The
# external forces are specified by Material Properties.  The
# relationships between the Fields and the Flux are also given by
# Material Properties (ie, they're not specified here!).

JamEqn = problem.advertise(equation.DivergenceEquation(
    'Jam_Eqn', 
    Jam,
예제 #3
0
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# [email protected]. 

from ooflib.engine import problem
from ooflib.SWIG.engine import flux
from ooflib.SWIG.engine import equation
from ooflib.SWIG.engine import field
from ooflib.SWIG.engine import fieldindex
from ooflib.SWIG.common import config
from ooflib.engine import conjugate

# Define a field.  This creates an object named 'Concentration' in the
# OOF namespace.
Concentration = problem.advertise(field.ScalarField('Concentration'))
# Define a flux
Atom_Flux = problem.advertise(flux.VectorFlux('Atom_Flux'))
Charge_Flux = problem.advertise(flux.VectorFlux('Charge_Flux'))

# And equations
AtomBalanceEquation = problem.advertise(equation.DivergenceEquation(
    'Atom_Eqn',
    Atom_Flux,
    1
    ))

ChargeBalanceEquation = problem.advertise(equation.DivergenceEquation(
    'Charge_Eqn',
    Charge_Flux,
    1