Changeset 5300 in historical


Ignore:
Timestamp:
08/16/12 11:37:48 (2 years ago)
Author:
guyer
Message:

merged source:branches/documentation@5299 to source:trunk@5299

Location:
trunk
Files:
44 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/INSTALLATION.txt

    r5140 r5300  
    169169 
    170170   :term:`FiPy` requires at least version 2.4.x of :term:`Python`. See 
    171    :ref:`RunningUnderPython3` for instructions on how to run 
    172    :term:`FiPy` with `Python 3.x`_. 
    173  
    174 .. _Python 3.x:   http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://docs.python.org/py3k/ 
     171   the specialized instructions if you wish to :ref:`RunUnderPython3`. 
     172 
    175173.. _download: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.python.org/download/ 
    176174 
  • trunk/README.txt

    r5140 r5300  
    5555The significant changes since version 2.1 are: 
    5656 
     57- :ref:`CoupledEquations` are now supported. 
     58- A more robust mechanism for specifying :ref:`BoundaryConditions` is now  
     59  used. 
     60- Most :class:`~fipy.meshes.mesh.Mesh`\es can be partitioned by  
     61  :ref:`MeshingWithGmsh`. 
     62- :ref:`PYAMG` and :ref:`SCIPY` have been added to the :ref:`SOLVERS`. 
     63- FiPy is capable of :ref:`RunningUnderPython3`. 
     64- "getter" and "setter" methods have been pervasively changed to Python  
     65  properties. 
     66- The test suite now runs much faster. 
    5767- Tests can now be run on a full install using `fipy.test()`. 
    58 - Grid classes now take an `Lx` argument.  
    5968- The functions of the :mod:`~fipy.tools.numerix` module are no longer  
    6069  included in the :mod:`fipy` namespace. See :mod:`examples.updating.update2_0to3_0`  
    6170  for details. 
    62 - Support for Python 3. Please see :ref:`RunningUnderPython3` for details. 
     71- Equations containing a :class:`~fipy.terms.transientTerm.TransientTerm`, 
     72  must specify the timestep by passing a ``dt=`` argument when calling 
     73  :meth:`~fipy.terms.term.Term.solve` or :meth:`~fipy.terms.term.Term.sweep`. 
    6374 
    6475Tickets fixed in this release:: 
    6576 
    66     171 update the mayavi viewer to use  mayavi 2 
    67     286 'matplotlib: list index out of range' when no title given, but only sometimes 
    68     197 ~binOp doesn't work on branches/version-2_0 
    69     194 `easy_install` instructions for MacOSX are broken 
    70     192 broken setuptools url with python 2.6 
    71     184 The FiPy webpage seems to be broken on Internet Explorer 
    72     168 Switch documentation to use `:math:` directive 
    73     198 FiPy2.0.2 LinearJORSolver.__init__  calls Solver rather than PysparseSolver 
    74     199 `gmshExport.exportAsMesh()` doesn't work 
    75     195 broken arithmetic face to cell distance calculations 
     77    45  Navier Stokes 
     78    85  CellVariable hasOld() should set self.old 
     79    101 Grids should take Lx, Ly, Lz arguments 
     80    145 tests should be run with fipy.tests() 
     81    177 remove ones and zeros from numerix.py 
     82    178 Default time steps should be infinite 
     83    291 term multiplication changes result 
     84    296 FAQ gives bad guidance for anisotropic diffusion 
     85    297 Use physical velocity in the manual/FAQ 
     86    298 mesh manipulation of periodic meshes leads to errors 
     87    299 Give helpfull error on - or / of meshes 
     88    301 wrong cell to cell normal in periodic meshes 
     89    302 gnuplot1d gives error on plot of facevariable 
     90    309 pypi is failing 
     91    312 Fresh FiPy gives ""ImportError: No viewers found""" 
     92    314 Absence of enthought.tvtk causes test failures 
     93    319 mesh in FiPy name space 
     94    324 --pysparse configuration should never attempt MPI imports 
     95    327 factoryMeshes.py not up to date with respect to keyword arguments 
     96    331 changed constraints don't propagate 
     97    332 anisotropic diffusion and constraints don't mix 
     98    333 `--Trilinos --no-pysparse` uses PySparse?!? 
     99    336 Profile and merge reconstrain branch 
     100    339 close out reconstrain branch 
     101    341 Fix fipy.terms._BinaryTerm test failure in parallel 
     102    343 diffusionTerm(var=var1).solver(var=var0) should fail sensibly 
     103    346 TeX is wrong in examples.phase.quaternary 
     104    348 Include Benny's improved interpolation patch 
     105    354 GmshExport is not tested and does not work 
     106    355 Introduce mesh.x as shorthand for mesh.cellCenters[0] etc 
     107    356 GmshImport should support all element types 
     108    357 GmshImport should read element colors 
     109    363 Reduce the run times for chemotaxis tests 
     110    366 tests take *too* long!!! 
     111    369 Make DiffusionTermNoCorrection the default 
     112    370 Epetra Norm2 failure in parallel 
     113    373 remove deprecated `steps=` from Solver 
     114    376 remove deprecated `diffusionTerm=` argument to ConvectionTerm 
     115    377 remove deprecated `NthOrderDiffusionTerm` 
     116    380 remove deprecated Variable.transpose() 
     117    381 remove deprecated viewers.make() 
     118    382 get running in Py3k 
     119    384 gmsh importer and gmsh tests don't clean up after themselves 
     120    385 `diffusionTerm._test()` requires PySparse 
     121    390 Improve test reporting to avoid inconsequential buildbot failures 
     122    391 efficiency_test chokes on liquidVapor2D.py 
     123    393 two `--scipy` failures 
     124    395 `--pysparse --inline` failures 
     125    417 Memory consumption growth with repeated meshing, especially with Gmsh 
     126    418 Viewers not working when plotting meshes with zero cells in parallel 
     127    419 examples/cahnHilliard/mesh2D.py broken with --trilinos 
     128    420 Epetra.PyComm() broken on Debian 
     129    421 cellVariable.min() broken in parallel 
     130    426 Add in parallel buildbot testing on more than 2 processors 
     131    427 Slow PyAMG solutions 
     132    434 Gmsh I/O 
     133    438 changes to gmshImport.py caused --inline problems 
     134    439 gmshImport tests fail on Windows due to shared file 
     135    441 Explicit convetion terms should fail when the equation has no TransientTerm (dt=None) 
     136    445 getFaceCenters() should return a FaceVariable 
     137    446 constraining values with ImplictSourceTerm not documented? 
     138    448 Gmsh2D does not respect background mesh 
     139    452 Gmsh background mesh doesn't work in parallel 
     140    453 faceValue as FaceCenters gives inline failures 
     141    454 Py3k and Windows test failures 
    76142 
    77143.. warning:: 
  • trunk/documentation/FAQ.txt

    r5234 r5300  
    9898 
    9999It is important to realize that, even though an expression may 
    100 superficially resemble one of those shown above, if the dependent variable 
     100superficially resemble one of those shown in :ref:`section:discretization`, if the dependent variable 
    101101*for that PDE* does not appear in the appropriate place, then that 
    102102term should be treated as a source. 
     
    193193>>> eq = TransientTerm() == (DiffusionTerm(coeff=D1)  
    194194...                          + <Specific>ConvectionTerm(coeff=D2 * xi.faceGrad)) 
     195 
     196.. note:: 
     197 
     198   With the advent of :ref:`CoupledEquations` in FiPy 3.x, it is now 
     199   possible to represent both terms with 
     200   :class:`~fipy.terms.diffusionTerm.DiffusionTerm`. 
    195201 
    196202What if the coefficient of a term depends on the variable that I'm solving for? 
     
    297303:class:`Viewer <viewer.AbstractViewer>` that comes closest to producing the image you want. You can 
    298304then override just the behavior you wan to change, while letting :term:`FiPy` do 
    299 most of the heavy lifting. See :mod:`examples.phase.anisotropy` for an 
    300 example of creating a custom :term:`Matplotlib` :class:`Viewer  
    301 <viewer.AbstractViewer>` class. 
     305most of the heavy lifting. See :mod:`examples.phase.anisotropy` and 
     306:mod:`examples.phase.polyxtal` for examples of creating a custom 
     307:term:`Matplotlib` :class:`Viewer <viewer.AbstractViewer>` class; see 
     308:mod:`examples.cahnHilliard.sphere` for an example of creating a custom 
     309:term:`Mayavi` :class:`Viewer <viewer.AbstractViewer>` class. 
    302310 
    303311.. _FAQ-IterationsTimestepsSweeps: 
     
    391399  :mod:`examples.diffusion.mesh1D`,  
    392400  :mod:`examples.phase.simple`,  
    393   :mod:`examples.phase.binary`, and :mod:`examples.flow.stokesCavity`. 
     401  :mod:`examples.phase.binaryCoupled`, and :mod:`examples.flow.stokesCavity`. 
    394402 
    395403timesteps 
     
    437445  :mod:`examples.phase.simple`. The timestep is gradually 
    438446  increased as the kinetics slow down in 
    439   :mod:`examples.cahnHilliard.mesh2D`. 
     447  :mod:`examples.cahnHilliard.mesh2DCoupled`. 
    440448 
    441449Finally, we can (and often do) combine all three layers of repetition: 
     
    497505.. currentmodule:: fipy.variables.cellVariable 
    498506 
    499 How do I represent a fixed value (Dirichlet) boundary condition? 
    500 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    501  
    502 Use the :meth:`~CellVariable.constrain` method. For 
    503 example, to fix `var` to have a value of `2` along the upper surface of a domain, 
    504 use 
    505  
    506 >>> var.constrain(2., where=mesh.facesTop) 
    507  
    508 .. note::  
    509  
    510    The old equivalent 
    511    :class:`~fipy.boundaryConditions.fixedValue.FixedValue` boundary 
    512    condition is now deprecated. 
    513  
    514 How do I apply a (Neumann) fixed gradient boundary condition? 
    515 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    516  
    517 Use the :attr:`~.CellVariable.faceGrad`.\ :meth:`~fipy.variables.variable.Variable.constrain` 
    518 method. For example, to fix `var` to have a gradient of `(0,2)` along the upper 
    519 surface of a 2D domain, use 
    520  
    521 >>> var.faceGrad.constrain(((0,),(2,)), where=mesh.facesTop) 
    522  
    523 How do I apply a fixed flux boundary condition? 
    524 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    525  
    526 Generally this can be implemented with a judicious use of 
    527 :attr:`~.CellVariable.faceGrad`.\ :meth:`~fipy.variables.variable.Variable.constrain`. 
    528 Failing that, an exterior flux term can be added to the equation. Firstly, 
    529 set the terms' coefficients to be zero on the exterior faces, 
    530  
    531 >>> diffCoeff.constrain(0., mesh.exteriorFaces) 
    532 >>> convCoeff.constrain(0., mesh.exteriorFaces) 
    533  
    534 then create an equation with an extra term to account for the exterior flux, 
    535  
    536 >>> eqn = (TransientTerm() + ConvectionTerm(convCoeff)  
    537 ...        == DiffusionCoeff(diffCoeff) 
    538 ...        + (mesh.exteriorFaces * exteriorFlux).divergence) 
    539  
    540 where `exteriorFlux` is a rank 1 
    541 :class:`~fipy.variables.faceVariable.FaceVariable`. 
    542  
    543 .. note::  
    544  
    545    The old equivalent :class:`~fipy.boundaryConditions.fixedFlux.FixedFlux` 
    546    boundary condition is now deprecated. 
    547  
    548 How do I apply an outlet or inlet boundary condition? 
    549 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    550  
    551 Convection terms default to a no flux boundary condition unless the 
    552 exterior faces are associated with a constraint, in which case either 
    553 an inlet or an outlet boundary condition is applied depending on the 
    554 flow direction. 
    555  
    556 How do I apply spatially varying boundary conditions? 
    557 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    558  
    559 The use of spatial varying boundary conditions is best demonstrated with an 
    560 example. Given a 2D equation in the domain :math:`0 < x < 1` and :math:`0 < y < 1` with 
    561 boundary conditions, 
    562  
    563 .. math:: 
    564  
    565   \phi = \left\{ 
    566             \begin{aligned}  
    567                 xy &\quad \text{on $x>1/2$ and $y>1/2$} \\ 
    568                 \vec{n} \cdot \vec{F} = 0 &\quad \text{elsewhere} 
    569             \end{aligned} 
    570         \right. 
    571  
    572 where :math:`\vec{F}` represents the flux. The boundary conditions in :term:`FiPy` can 
    573 be written with the following code, 
    574  
    575 >>> x, y = mesh.faceCenters 
    576 >>> mask =  ((x < 0.5) | (y < 0.5)) 
    577 >>> var.faceGrad.constrain(0, where=mesh.exteriorFaces & mask) 
    578 >>> var.constrain(x * y, where=mesh.exteriorFaces & ~mask) 
    579  
    580 then 
    581  
    582 >>> eqn.solve(...) 
    583  
    584 Further demonstrations of spatially varying boundary condition can be found 
    585 in :mod:`examples.diffusion.mesh20x20` 
    586 and :mod:`examples.diffusion.circle` 
    587  
    588 .. %    http://thread.gmane.org/gmane.comp.python.fipy/726 
    589    %    http://thread.gmane.org/gmane.comp.python.fipy/846 
    590  
    591    %    \subsection{Fourth order boundary conditions} 
    592  
    593    %    http://thread.gmane.org/gmane.comp.python.fipy/923 
    594  
    595    %    \subsection{Periodic boundary conditions} 
    596  
    597    %    http://thread.gmane.org/gmane.comp.python.fipy/135 
    598  
    599    %    \subsection{Time dependent boundary conditions} 
    600  
    601    %    http://thread.gmane.org/gmane.comp.python.fipy/2 
    602  
    603    %    \subsection{Internal boundary conditions} 
     507See the :ref:`BoundaryConditions` section for more details. 
    604508 
    605509What does this error message mean? 
  • trunk/documentation/USAGE.txt

    r5214 r5300  
    224224:term:`FiPy` can use :term:`Trilinos` to solve equations in 
    225225parallel. Most mesh classes in :mod:`fipy.meshes` can solve in 
    226 paralled. This includes all "``...Grid...``" and "``...Gmsh...``" 
     226parallel. This includes all "``...Grid...``" and "``...Gmsh...``" 
    227227class meshes. Currently, the only remaining serial-only meshes are 
    228228:class:`~fipy.meshes.tri2D.Tri2D` and 
     
    325325        tolerance may help. 
    326326 
    327 .. _RunningUnderPython3: 
     327.. _MeshingWithGmsh: 
    328328 
    329329----------------- 
     
    354354    non-orthogonal or non-conjunctional meshes. 
    355355 
     356.. _CoupledEquations: 
     357 
    356358---------------------------- 
    357359Coupled and Vector Equations 
     
    361363all the equations appear in a single system matrix. This results in 
    362364tighter coupling for equations with spatial and temporal derivatives 
    363 in more than one variable. The use of coupled equation is described in 
    364 :mod:`examples.diffusin.coupled`. Other examples that demonstrate the 
    365 use of coupled equations are :mod:`examples.phase.binaryCoupled` and 
     365in more than one variable. In :term:`FiPy` equations are coupled 
     366together using the ``&`` operator:: 
     367 
     368   >>> eqn0 = ... 
     369   >>> eqn1 = ... 
     370   >>> coupledEqn = eqn0 & eqn1 
     371 
     372The ``coupledEqn`` will use a combined system matrix that includes 
     373four quadrants for each of the different variable and equation 
     374combinations. In previous versions of :term:`FiPy` there has been no 
     375need to specify which variable a given term acts on when generating 
     376equations. The variable is simply specified when calling ``solve`` or 
     377``sweep`` and this functionality has been maintained in the case of 
     378single equations. However, for coupled equations the variable that a 
     379given term operates on now needs to be specified when the equation is 
     380generated. The syntax for generating coupled equations has the form:: 
     381 
     382   >>> eqn0 = Term00(coeff=..., var=var0) + Term01(coeff..., var=var1) == source0 
     383   >>> eqn1 = Term10(coeff=..., var=var0) + Term11(coeff..., var=var1) == source1 
     384   >>> coupledEqn = eqn0 & eqn1 
     385 
     386and there is now no need to pass any variables when solving:: 
     387 
     388   >>> coupledEqn.solve(dt=..., solver=...) 
     389 
     390In this case the matrix system will have the form 
     391 
     392.. math:: 
     393 
     394   \left( 
     395   \begin{array}{c|c} 
     396   \text{\ttfamily Term00} & \text{\ttfamily Term01} \\ \hline 
     397   \text{\ttfamily Term10} & \text{\ttfamily Term11} 
     398   \end{array} \right) 
     399   \left( 
     400   \begin{array}{c} 
     401   \text{\ttfamily var0}  \\ \hline 
     402   \text{\ttfamily var1}  
     403   \end{array} \right) 
     404   =            
     405   \left( 
     406   \begin{array}{c} 
     407   \text{\ttfamily source0}  \\ \hline 
     408   \text{\ttfamily source1}  
     409   \end{array} \right) 
     410    
     411:term:`FiPy` tries to make sensible decisions regarding each term's 
     412location in the matrix and the ordering of the variable column 
     413array. For example, if ``Term01`` is a transient term then ``Term01`` 
     414would appear in the upper left diagonal and the ordering of the 
     415variable column array would be reversed. 
     416 
     417The use of coupled equation is described in detail in 
     418:mod:`examples.diffusion.coupled`. Other examples that demonstrate the 
     419use of coupled equations are :mod:`examples.phase.binaryCoupled`, 
     420:mod:`examples.phase.polyxtalCoupled` and 
    366421:mod:`examples.cahnHilliard.mesh2DCoupled`. As well as coupling 
    367422equations, true vector equations can now be written in :term:`FiPy` 
    368423(see :mod:`examples.diffusion.coupled` for more details). 
     424 
     425.. _BoundaryConditions: 
     426 
     427------------------- 
     428Boundary Conditions 
     429------------------- 
     430 
     431.. currentmodule:: fipy.variables.cellVariable 
     432 
     433Applying fixed value (Dirichlet) boundary conditions 
     434==================================================== 
     435 
     436To apply a fixed value boundary condition use the 
     437:meth:`~CellVariable.constrain` method. For example, to fix `var` to 
     438have a value of `2` along the upper surface of a domain, use 
     439 
     440>>> var.constrain(2., where=mesh.facesTop) 
     441 
     442.. note::  
     443 
     444   The old equivalent 
     445   :class:`~fipy.boundaryConditions.fixedValue.FixedValue` boundary 
     446   condition is now deprecated. 
     447 
     448Applying fixed gradient boundary conditions (Neumann) 
     449===================================================== 
     450 
     451To apply a fixed Gradient boundary condition use the 
     452:attr:`~.CellVariable.faceGrad`.\ 
     453:meth:`~fipy.variables.variable.Variable.constrain` method. For 
     454example, to fix `var` to have a gradient of `(0,2)` along the upper 
     455surface of a 2D domain, use 
     456 
     457>>> var.faceGrad.constrain(((0,),(2,)), where=mesh.facesTop) 
     458 
     459Applying fixed flux boundary conditions 
     460======================================= 
     461 
     462Generally these can be implemented with a judicious use of 
     463:attr:`~.CellVariable.faceGrad`.\ 
     464:meth:`~fipy.variables.variable.Variable.constrain`.  Failing that, an 
     465exterior flux term can be added to the equation. Firstly, set the 
     466terms' coefficients to be zero on the exterior faces, 
     467 
     468>>> diffCoeff.constrain(0., mesh.exteriorFaces) 
     469>>> convCoeff.constrain(0., mesh.exteriorFaces) 
     470 
     471then create an equation with an extra term to account for the exterior flux, 
     472 
     473>>> eqn = (TransientTerm() + ConvectionTerm(convCoeff)  
     474...        == DiffusionCoeff(diffCoeff) 
     475...        + (mesh.exteriorFaces * exteriorFlux).divergence) 
     476 
     477where `exteriorFlux` is a rank 1 
     478:class:`~fipy.variables.faceVariable.FaceVariable`. 
     479 
     480.. note::  
     481 
     482   The old equivalent :class:`~fipy.boundaryConditions.fixedFlux.FixedFlux` 
     483   boundary condition is now deprecated. 
     484 
     485Applying outlet or inlet boundary conditions 
     486============================================ 
     487 
     488Convection terms default to a no flux boundary condition unless the 
     489exterior faces are associated with a constraint, in which case either 
     490an inlet or an outlet boundary condition is applied depending on the 
     491flow direction. 
     492 
     493Applying spatially varying boundary conditions 
     494============================================== 
     495 
     496The use of spatial varying boundary conditions is best demonstrated with an 
     497example. Given a 2D equation in the domain :math:`0 < x < 1` and :math:`0 < y < 1` with 
     498boundary conditions, 
     499 
     500.. math:: 
     501 
     502  \phi = \left\{ 
     503            \begin{aligned}  
     504                xy &\quad \text{on $x>1/2$ and $y>1/2$} \\ 
     505                \vec{n} \cdot \vec{F} = 0 &\quad \text{elsewhere} 
     506            \end{aligned} 
     507        \right. 
     508 
     509where :math:`\vec{F}` represents the flux. The boundary conditions in :term:`FiPy` can 
     510be written with the following code, 
     511 
     512>>> X, Y = mesh.faceCenters 
     513>>> mask =  ((X < 0.5) | (Y < 0.5)) 
     514>>> var.faceGrad.constrain(0, where=mesh.exteriorFaces & mask) 
     515>>> var.constrain(X * Y, where=mesh.exteriorFaces & ~mask) 
     516 
     517then 
     518 
     519>>> eqn.solve(...) 
     520 
     521Further demonstrations of spatially varying boundary condition can be found 
     522in :mod:`examples.diffusion.mesh20x20` 
     523and :mod:`examples.diffusion.circle` 
     524 
     525Applying internal boundary conditions 
     526===================================== 
     527 
     528Applying internal boundary conditions can be achieved through the use 
     529of implicit and explicit sources. An equation of the form 
     530 
     531>>> eqn = TransientTerm() == DiffusionTerm() 
     532 
     533can be constrained to have a fixed internal ``value`` at a position 
     534given by ``mask`` with the following alterations 
     535 
     536>>> eqn = TransientTerm() == DiffusionTerm() - ImplicitSourceTerm(mask * largeValue) + mask * largeValue * value  
     537 
     538The parameter ``largeValue`` must be chosen to be large enough to 
     539completely dominate the matrix diagonal and the RHS vector in cells 
     540that are masked. The ``mask`` variable would typically be a 
     541``CellVariable`` boolean constructed using the cell center values. 
     542 
     543One must be careful to distinguish between constraining internal cell 
     544values during the solve step and simply applying arbitrary constraints 
     545to a ``CellVariable``. Applying a constraint, 
     546 
     547>>> var.constrain(value, where=mask) 
     548 
     549simply fixes the returned value of ``var`` at ``mask`` to be 
     550``value``. It does not have any effect on the implicit value of ``var`` at the 
     551``mask`` location during the linear solve so it is not a substitute 
     552for the source term machinations described above. Future releases of 
     553:term:`FiPy` may implicitly deal with this discrepancy, but the current 
     554release does not. A simple example can be used to demonstrate this:: 
     555 
     556>>> m = Grid1D(nx=2, dx=1.) 
     557>>> var = CellVariable(mesh=m) 
     558 
     559Apply a constraint to the faces for a right side boundary condition 
     560(which works). 
     561 
     562>>> var.constrain(1., where=m.facesRight) 
     563 
     564Create the equation with the source term constraint described above 
     565 
     566>>> mask = m.x < 1. 
     567>>> largeValue = 1e+10 
     568>>> value = 0.25 
     569>>> eqn = DiffusionTerm() - ImplicitSourceTerm(largeValue * mask) + largeValue * mask * value 
     570 
     571and the expected value is obtained. 
     572 
     573>>> eqn.solve(var) 
     574>>> print var 
     575[ 0.25  0.75] 
     576 
     577However, if a constraint is used without the source term constraint an 
     578unexpected value is obtained 
     579 
     580>>> var.constrain(0.25, where=mask) 
     581>>> eqn = DiffusionTerm() 
     582>>> eqn.solve(var) 
     583>>> print var 
     584[ 0.25  1.  ] 
     585 
     586although the left cell has the expected value as it is constrained. 
     587 
     588.. %    http://thread.gmane.org/gmane.comp.python.fipy/726 
     589   %    http://thread.gmane.org/gmane.comp.python.fipy/846 
     590 
     591   %    \subsection{Fourth order boundary conditions} 
     592 
     593   %    http://thread.gmane.org/gmane.comp.python.fipy/923 
     594 
     595   %    \subsection{Periodic boundary conditions} 
     596 
     597   %    http://thread.gmane.org/gmane.comp.python.fipy/135 
     598 
     599   %    \subsection{Time dependent boundary conditions} 
     600 
     601   %    http://thread.gmane.org/gmane.comp.python.fipy/2 
     602 
     603   %    \subsection{Internal boundary conditions} 
     604 
     605.. _RunningUnderPython3: 
    369606 
    370607---------------------- 
  • trunk/documentation/numerical/discret.txt

    r5140 r5300  
    183183>>> DiffusionTerm(coeff=Gamma1) 
    184184 
    185 which is synonymous with 
    186  
    187 >>> ImplicitDiffusionTerm(coeff=Gamma1) 
    188      
    189185or  
    190186 
    191187>>> ExplicitDiffusionTerm(coeff=Gamma1) 
    192      
     188 
    193189:class:`~explicitDiffusionTerm.ExplicitDiffusionTerm` is provided primarily for 
    194190illustrative purposes, although :mod:`examples.diffusion.mesh1D`  
     
    273269results in a sparse linear system that requires an efficient iterative 
    274270scheme to solve. The iterative schemes available to :term:`FiPy` are 
    275 currently encapsulated in the :term:`PySparse` suite of solvers 
    276 and include most common solvers such as the conjugate gradient method 
    277 and LU decomposition. There are plans to include other solver suites 
    278 that are compatible with :term:`Python`. 
     271currently encapsulated in the :term:`PySparse` and :term:`PyTrilinos`  
     272suites of solvers and include most common solvers such as the conjugate 
     273gradient method and LU decomposition. 
    279274 
    280275Combining Equations :eq:`num:tra`, :eq:`num:con`, 
  • trunk/documentation/numerical/equation.txt

    r5140 r5300  
    2222such diverse problems as determination of the electric potential in 
    2323heart tissue, of fluid flow, stress evolution, and even the 
    24 Schr\"odinger equation. 
     24Schroedinger equation. 
    2525 
    2626A general conservation equation, solved using :term:`FiPy`, can include any 
  • trunk/documentation/numerical/index.txt

    r5021 r5300  
    2525the FEM using as weighting functions the characteristic functions of 
    2626FV cells, i.e., functions equal to unity [Mattiussi:1997]_. Analogously, 
    27 the the discretization of equations with the FVM reduces to the FDM on 
     27the discretization of equations with the FVM reduces to the FDM on 
    2828Cartesian grids. 
    2929 
  • trunk/documentation/tutorial/index.txt

    r5140 r5300  
    1515   :maxdepth: 4 
    1616 
    17    package/generated/subpackage 
     17   package/generated/package.subpackage 
    1818 
  • trunk/examples/cahnHilliard/mesh2DCoupled.py

    r5214 r5300  
    3232 ## 
    3333 
    34 r""" 
     34r"""Solve the Cahn-Hilliard problem in two dimensions. 
     35 
    3536The spinodal decomposition phenomenon is a spontaneous separation of 
    3637an initially homogenous mixture into two distinct regions of different 
     
    172173 
    173174>>> source = (- d2fdphi2 * v0 + dfdphi) * (0, 1) 
    174 >>> impCoeff = -d2fdphi2 * ((0, 0), (1., 0)) + ((0, 0), (0, -1.)) 
     175>>> impCoeff = -d2fdphi2 * ((0, 0),  
     176...                         (1., 0)) + ((0, 0),  
     177...                                     (0, -1.)) 
    175178 
    176179This is the same equation as the previous definition of `eq`, but now in 
    177180a vector format. 
    178181 
    179 >>> eq = TransientTerm(((1., 0.), (0., 0.))) == DiffusionTerm([((0., D), (-epsilon**2, 0.))]) + ImplicitSourceTerm(impCoeff) + source 
     182>>> eq = TransientTerm(((1., 0.),  
     183...                     (0., 0.))) == DiffusionTerm([((0.,          D),  
     184...                                                   (-epsilon**2, 0.))]) + ImplicitSourceTerm(impCoeff) + source 
    180185 
    181186>>> dexp = -5 
  • trunk/examples/cahnHilliard/sphere.py

    r5140 r5300  
    3232 ## 
    3333 
    34 r"""  
    35 Solves the Cahn-Hilliard problem on the surface of a sphere, such as 
    36 may occur on vesicles (http://www.youtube.com/watch?v=kDsFP67_ZSE). 
     34r"""Solves the Cahn-Hilliard problem on the surface of a sphere. 
     35 
     36This phenomenon canoccur on vesicles (http://www.youtube.com/watch?v=kDsFP67_ZSE). 
    3737 
    3838>>> from fipy import * 
  • trunk/examples/convection/exponential1D/mesh1D.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the steady-state convection-diffusion equation in one dimension. 
    3636 
    3737This example solves the steady-state convection-diffusion equation 
     
    4242   \nabla \cdot \left(D \nabla \phi + \vec{u} \phi \right) = 0 
    4343 
    44 with coefficients :math:`D = 1` and :math:`\vec{u} = (10,)`, or 
     44with coefficients :math:`D = 1` and :math:`\vec{u} = 10\hat{\i}`, or 
    4545 
    4646>>> diffCoeff = 1. 
     
    6262The solution variable is initialized to ``valueLeft``: 
    6363 
    64 >>> var = CellVariable(mesh=mesh, name = "variable") 
     64>>> var = CellVariable(mesh=mesh, name="variable") 
    6565 
    6666and impose the boundary conditions 
  • trunk/examples/convection/exponential1DSource/mesh1D.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the steady-state convection-diffusion equation with a constant source. 
    3636 
    3737Like :mod:`examples.convection.exponential1D.mesh1D` 
  • trunk/examples/convection/robin.py

    r4847 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve an advection-diffusion equation with a Robin boundary condition. 
    3636 
    3737This example demonstrates how to apply a Robin boundary condition to 
  • trunk/examples/convection/source.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a convection problem with a source. 
     36 
    3637This example solves the equation 
    3738 
     
    4546currently implemented in FiPy. An :class:`~fipy.terms.implicitSourceTerm.ImplicitSourceTerm` object 
    4647will be used to represent this term. The derivative of :math:`\phi` can be 
    47 represented by a :class:`~fipy.terms.abstractConvectionTerm._AbstractConvectionTerm` with a constant unitary velocity 
     48represented by a :class:`~fipy.terms.ConvectionTerm` with a constant unitary velocity 
    4849field from left to right. The following is an example code that includes 
    4950a test against the analytical result. 
  • trunk/examples/diffusion/anisotropy.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the diffusion equation with an anisotropic diffusion coefficient. 
    3636 
    37 This example demonstrates how to solve diffusion with an anisotropic 
    38 coefficient.  We wish to solve the problem 
     37We wish to solve the problem 
    3938 
    4039.. math:: 
     
    8786>>> mesh = Gmsh2D(os.path.splitext(__file__)[0] + '.msh', communicator=serial) # doctest: +GMSH 
    8887 
    89 Set the center most cell to have a value. 
     88Set the centermost cell to have a value. 
    9089 
    9190>>> var = CellVariable(mesh=mesh, hasOld=1) # doctest: +GMSH 
  • trunk/examples/diffusion/circle.py

    r5287 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the diffusion equation in a circular domain meshed with triangles. 
     36 
    3637This example demonstrates how to solve a simple diffusion problem on a 
    3738non-standard mesh with varying boundary conditions. The :term:`Gmsh` package 
     
    5556>>> from fipy import * 
    5657>>> mesh = Gmsh2D(''' 
    57 ...                       cellSize = %(cellSize)g; 
    58 ...                       radius = %(radius)g; 
    59 ...                       Point(1) = {0, 0, 0, cellSize}; 
    60 ...                       Point(2) = {-radius, 0, 0, cellSize}; 
    61 ...                       Point(3) = {0, radius, 0, cellSize}; 
    62 ...                       Point(4) = {radius, 0, 0, cellSize}; 
    63 ...                       Point(5) = {0, -radius, 0, cellSize}; 
    64 ...                       Circle(6) = {2, 1, 3}; 
    65 ...                       Circle(7) = {3, 1, 4}; 
    66 ...                       Circle(8) = {4, 1, 5}; 
    67 ...                       Circle(9) = {5, 1, 2}; 
    68 ...                       Line Loop(10) = {6, 7, 8, 9}; 
    69 ...                       Plane Surface(11) = {10}; 
    70 ...                       ''' % locals()) # doctest: +GMSH 
     58...               cellSize = %(cellSize)g; 
     59...               radius = %(radius)g; 
     60...               Point(1) = {0, 0, 0, cellSize}; 
     61...               Point(2) = {-radius, 0, 0, cellSize}; 
     62...               Point(3) = {0, radius, 0, cellSize}; 
     63...               Point(4) = {radius, 0, 0, cellSize}; 
     64...               Point(5) = {0, -radius, 0, cellSize}; 
     65...               Circle(6) = {2, 1, 3}; 
     66...               Circle(7) = {3, 1, 4}; 
     67...               Circle(8) = {4, 1, 5}; 
     68...               Circle(9) = {5, 1, 2}; 
     69...               Line Loop(10) = {6, 7, 8, 9}; 
     70...               Plane Surface(11) = {10}; 
     71...               ''' % locals()) # doctest: +GMSH 
    7172 
    7273Using this mesh, we can construct a solution variable 
  • trunk/examples/diffusion/circleQuad.py

    r5287 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the diffusion equation in a circular domain meshed with quadrangles. 
     36 
    3637This example demonstrates how to solve a simple diffusion problem on a 
    3738non-standard mesh with varying boundary conditions. The :term:`Gmsh` package 
  • trunk/examples/diffusion/coupled.py

    r5214 r5300  
    3333 ## 
    3434 
    35 r""" 
    36 How to use coupled equations. 
     35r"""Solve the biharmonic equation as a coupled pair of diffusion equations. 
    3736 
     37:term:`FiPy` has only first order time derivatives so equations such 
     38as the biharmonic wave equation written as 
    3839 
    39 ## Coupled 
     40.. math:: 
     41     
     42   \frac{\partial^4 v}{\partial x^4} + \frac{\partial^2 v}{\partial t^2} &= 0 
     43    
     44cannot be represented as a single equation. We need to decompose the 
     45biharmonic equation into two equations that are first order in time in 
     46the following way, 
    4047 
     48.. math:: 
     49     
     50   \frac{\partial^2 v_0}{\partial x^2} + \frac{\partial v_1}{\partial t} &= 0 \\ 
     51   \frac{\partial^2 v_1}{\partial x^2} - \frac{\partial v_0}{\partial t} &= 0  
    4152 
    42 from fipy import Grid1D, CellVariable, TransientTerm, DiffusionTerm, Viewer 
     53Historically, :term:`FiPy` required systems of coupled equations to be 
     54solved successively, "sweeping" the equations to convergence. As a 
     55practical example, we use the following system 
    4356 
    44 m = Grid1D(nx=100, Lx=1.) 
     57.. math:: 
     58     
     59   \frac{\partial v_0}{\partial t} &= 0.01 \nabla^2 v_0 - \nabla^2 v_1 \\ 
     60   \frac{\partial v_1}{\partial t} &= \nabla^2 v_0 + 0.01 \nabla^2 v_1 
     61    
     62subject to the boundary conditions  
    4563 
    46 v0 = CellVariable(mesh=m, hasOld=True, value=0.5) 
    47 v1 = CellVariable(mesh=m, hasOld=True, value=0.5) 
     64.. math:: 
     65   :nowrap: 
     66     
     67   \begin{align*} 
     68   v_0|_{x=0} &= 0 & v_0|_{x=1} &= 1 \\ 
     69   v_1|_{x=0} &= 1 & v_1|_{x=1} &= 0 
     70   \end{align*} 
    4871 
    49 v0.constrain(0, m.facesLeft) 
    50 v0.constrain(1, m.facesRight) 
     72This system closely resembles the pure biharmonic equation, but has an 
     73additional diffusion contribution to improve numerical stability.  The 
     74example system is solved with the following block of code using 
     75explicit coupling for the cross-coupled terms. 
    5176 
    52 v1.constrain(1, m.facesLeft) 
    53 v1.constrain(0, m.facesRight) 
     77>>> from fipy import Grid1D, CellVariable, TransientTerm, DiffusionTerm, Viewer 
    5478 
    55 eqn0 = TransientTerm(var=v0) == DiffusionTerm(-1, var=v1) + DiffusionTerm(0.01, var=v0) 
    56 eqn1 = TransientTerm(var=v1) == DiffusionTerm(1, var=v0) + DiffusionTerm(0.01, var=v1) 
     79>>> m = Grid1D(nx=100, Lx=1.) 
    5780 
    58 eqn = eqn0 & eqn1 
     81>>> v0 = CellVariable(mesh=m, hasOld=True, value=0.5) 
     82>>> v1 = CellVariable(mesh=m, hasOld=True, value=0.5) 
    5983 
    60 vi = Viewer((v0, v1)) 
     84>>> v0.constrain(0, m.facesLeft) 
     85>>> v0.constrain(1, m.facesRight) 
    6186 
    62 for t in range(1):  
    63     v0.updateOld() 
    64     v1.updateOld() 
    65     eqn.solve(dt=1.) 
    66     vi.plot() 
     87>>> v1.constrain(1, m.facesLeft) 
     88>>> v1.constrain(0, m.facesRight) 
    6789 
    68 ## Vector 
     90>>> eq0 = TransientTerm() == DiffusionTerm(coeff=0.01) - v1.faceGrad.divergence 
     91>>> eq1 = TransientTerm() == v0.faceGrad.divergence + DiffusionTerm(coeff=0.01) 
    6992 
    70 v = CellVariable(mesh=m, hasOld=True, value=0.5, elementshape=(2,)) 
     93>>> vi = Viewer((v0, v1)) 
    7194 
    72 v.constrain(0, [m.facesLeft, m.facesRight]) 
    73 v.constrain(1, [m.facesRight, m.facesLeft]) 
     95>>> for t in range(100):  
     96...     v0.updateOld() 
     97...     v1.updateOld() 
     98...     res0 = res1 = 1e100 
     99...     while max(res0, res1) > 0.1: 
     100...         res0 = eq0.sweep(var=v0, dt=1e-5) 
     101...         res1 = eq1.sweep(var=v1, dt=1e-5) 
     102...     if t % 10 == 0: 
     103...         vi.plot() 
    74104 
    75 eqn = TransientTerm(((1, 0), (0, 1))) == DiffusionTerm([((0.01, -1), (1, 0.01))]) 
     105The uncoupled method still works, but it can be advantageous to solve 
     106the two equations simultaneously. In this case, by coupling the 
     107equations, we can eliminate the explicit sources and dramatically 
     108increase the time steps: 
    76109 
    77 vi = Viewer((v[0], v[1])) 
     110>>> v0.value = 0.5 
     111>>> v1.value = 0.5 
    78112 
    79 for t in range(1):  
    80     v.updateOld() 
    81     eqn.solve(var=v, dt=1.) 
    82     vi.plot() 
     113>>> eqn0 = TransientTerm(var=v0) == DiffusionTerm(0.01, var=v0) - DiffusionTerm(1, var=v1) 
     114>>> eqn1 = TransientTerm(var=v1) == DiffusionTerm(1, var=v0) + DiffusionTerm(0.01, var=v1) 
    83115 
    84 ## Uncoupled 
     116>>> eqn = eqn0 & eqn1 
    85117 
    86 m = Grid1D(nx=100, Lx=1.) 
     118>>> for t in range(1):  
     119...     v0.updateOld() 
     120...     v1.updateOld() 
     121...     eqn.solve(dt=1.e-3) 
     122...     vi.plot() 
    87123 
    88 v0 = CellVariable(mesh=m, hasOld=True, value=0.5) 
    89 v1 = CellVariable(mesh=m, hasOld=True, value=0.5) 
     124It is also possible to pose the same equations in vector form: 
    90125 
    91 v0.constrain(0, m.facesLeft) 
    92 v0.constrain(1, m.facesRight) 
     126>>> v = CellVariable(mesh=m, hasOld=True, value=[[0.5], [0.5]], elementshape=(2,)) 
    93127 
    94 v1.constrain(1, m.facesLeft) 
    95 v1.constrain(0, m.facesRight) 
     128>>> v.constrain([[0], [1]], m.facesLeft) 
     129>>> v.constrain([[1], [0]], m.facesRight) 
    96130 
    97 eq0 = TransientTerm() == -v1.faceGrad.divergence + DiffusionTerm(0.01) 
    98 eq1 = TransientTerm() == v0.faceGrad.divergence + DiffusionTerm(0.01) 
     131>>> eqn = TransientTerm([[1, 0],  
     132...                      [0, 1]]) == DiffusionTerm([[[0.01, -1],  
     133...                                                  [1, 0.01]]]) 
    99134 
    100 vi = Viewer((v0, v1)) 
     135>>> vi = Viewer((v[0], v[1])) 
    101136 
    102 for t in range(10000):  
    103     v0.updateOld() 
    104     v1.updateOld() 
    105     eq0.solve(var=v0, dt=1e-5) 
    106     eq1.solve(var=v1, dt=1e-5) 
    107     vi.plot() 
     137>>> for t in range(1):  
     138...     v.updateOld() 
     139...     eqn.solve(var=v, dt=1.e-3) 
     140...     vi.plot() 
    108141 
     142Whether you pose your problem in coupled or vector form should be dictated by 
     143the underlying physics. If :math:`v_0` and :math:`v_1` represent the 
     144concentrations of two conserved species, then it is natural to write two 
     145seperate governing equations and to couple them. If they represent two 
     146components of a vector field, then the vector formulation is obviously more 
     147natural. FiPy will solve the same matrix system either way. 
    109148""" 
     149__docformat__ = 'restructuredtext' 
     150 
     151if __name__ == '__main__': 
     152    import fipy.tests.doctestPlus 
     153    exec(fipy.tests.doctestPlus._getScript()) 
     154 
     155    raw_input('finished') 
     156 
  • trunk/examples/diffusion/electrostatics.py

    r5124 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the Poisson equation in one dimension. 
     36 
    3637The Poisson equation is a particular example of the steady-state diffusion 
    3738equation. We examine a few cases in one dimension. 
  • trunk/examples/diffusion/mesh1D.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a one-dimensional diffusion equation under different conditions. 
     36 
    3637To run this example from the base :term:`FiPy` directory, type:: 
    3738     
     
    5859>>> nx = 50 
    5960>>> dx = 1. 
    60 >>> mesh = Grid1D(nx = nx, dx = dx) 
     61>>> mesh = Grid1D(nx=nx, dx=dx) 
    6162 
    6263:term:`FiPy` solves all equations at the centers of the cells of the mesh. We 
     
    390391 
    391392>>> D = FaceVariable(mesh=mesh, value=1.0) 
    392 >>> x = mesh.faceCenters[0] 
    393 >>> D.setValue(0.1, where=(L / 4. <= x) & (x < 3. * L / 4.)) 
     393>>> X = mesh.faceCenters[0] 
     394>>> D.setValue(0.1, where=(L / 4. <= X) & (X < 3. * L / 4.)) 
    394395 
    395396The boundary conditions are a fixed value of  
  • trunk/examples/diffusion/mesh20x20.py

    r5124 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a two-dimensional diffusion problem in a square domain. 
    3636 
    3737This example solves a diffusion problem and demonstrates the use of 
     
    6969are automatically applied to the top-right and bottom-left corners. 
    7070 
    71 >>> x, y = mesh.faceCenters 
    72 >>> facesTopLeft = ((mesh.facesLeft & (y > L / 2)) 
    73 ...                 | (mesh.facesTop & (x < L / 2))) 
    74 >>> facesBottomRight = ((mesh.facesRight & (y < L / 2)) 
    75 ...                     | (mesh.facesBottom & (x > L / 2))) 
     71>>> X, Y = mesh.faceCenters 
     72>>> facesTopLeft = ((mesh.facesLeft & (Y > L / 2)) 
     73...                 | (mesh.facesTop & (X < L / 2))) 
     74>>> facesBottomRight = ((mesh.facesRight & (Y < L / 2)) 
     75...                     | (mesh.facesBottom & (X > L / 2))) 
    7676 
    7777>>> phi.constrain(valueTopLeft, facesTopLeft) 
  • trunk/examples/diffusion/mesh20x20Coupled.py

    r5214 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a coupled set of diffusion equations in two dimensions. 
    3636 
    3737This example solves a diffusion problem and demonstrates the use of 
  • trunk/examples/diffusion/nthOrder/input4thOrder1D.py

    r5124 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a fourth-order diffusion problem. 
    3636 
    3737This example uses the :class:`~fipy.terms.diffusionTerm.DiffusionTerm` class to solve the equation 
  • trunk/examples/flow/stokesCavity.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the Navier-Stokes equation in the viscous limit. 
    3636 
    3737Many thanks to Benny Malengier <[email protected]> for reworking this example and 
  • trunk/examples/levelSet/advection/circle.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a circular distance function equation and then advect it. 
     36 
    3637This example first imposes a circular distance function: 
    3738 
  • trunk/examples/levelSet/advection/mesh1D.py

    r4847 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the distance function equation in one dimension and then advect it. 
     36 
    3637This example first solves the distance function equation in one dimension: 
    3738 
  • trunk/examples/levelSet/distanceFunction/circle.py

    r4847 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve the level set equation in two dimensions for a circle.  
    3636 
    37 Here we solve the level set equation in two dimensions for a circle. The 2D 
    38 level set equation can be written, 
     37The 2D level set equation can be written, 
    3938 
    4039.. math:: 
  • trunk/examples/levelSet/distanceFunction/mesh1D.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Create a level set variable in one dimension.  
    3636 
    37 Here we create a level set variable in one dimension. The level set 
     37The level set 
    3838variable calculates its value over the domain to be the distance from 
    3939the zero level set. This can be represented succinctly in the 
  • trunk/examples/levelSet/electroChem/gold.py

    r5140 r5300  
    3232 ## 
    3333  
    34 r""" 
     34r"""Model electrochemical superfill of gold using the CEAC mechanism. 
     35 
    3536This input file 
    3637is a demonstration of the use of :term:`FiPy` for 
  • trunk/examples/levelSet/electroChem/howToWriteAScript.py

    r5140 r5300  
    3232 ## 
    3333 
    34 r""" 
     34r"""Tutorial for writing an electrochemical superfill script. 
    3535 
    3636This input file demonstrates how to 
  • trunk/examples/levelSet/electroChem/leveler.py

    r5140 r5300  
    3232 ## 
    3333 
    34 r""" 
     34r"""Model electrochemical superfill of copper with leveler and accelerator additives. 
     35 
    3536This input file is a demonstration of the use of :term:`FiPy` for 
    3637modeling copper superfill with leveler and accelerator 
  • trunk/examples/levelSet/electroChem/simpleTrenchSystem.py

    r5140 r5300  
    3232 ## 
    3333 
    34 r""" 
     34r"""Model electrochemical superfill using the CEAC mechanism. 
     35 
    3536This input file 
    3637is a demonstration of the use of :term:`FiPy` 
  • trunk/examples/phase/anisotropy.py

    r5140 r5300  
    3131 ## 
    3232 
    33 r""" 
     33r"""Solve a dendritic solidification problem. 
     34 
    3435To convert a liquid material to a solid,  it must be cooled to a  
    3536temperature below its melting point (known as "undercooling" or "supercooling"). The rate of  
  • trunk/examples/phase/binaryCoupled.py

    r5268 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Simultaneously solve a phase-field evolution and solute diffusion problem in one-dimension. 
     36 
    3637It is straightforward to extend a phase field model to include binary alloys. 
    3738As in :mod:`examples.phase.simple`, we will examine a 1D problem 
  • trunk/examples/phase/impingement/mesh20x20.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve for the impingement of four grains in two dimensions. 
    3636 
    3737In the following examples, we solve the same set of equations as in 
  • trunk/examples/phase/impingement/mesh40x1.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve for the impingement of two grains in one dimension. 
    3636 
    3737In this example we solve a coupled phase and orientation equation on a one 
  • trunk/examples/phase/index.txt

    r5214 r5300  
    1313   examples.phase.impingement.mesh40x1 
    1414   examples.phase.impingement.mesh20x20 
     15   examples.phase.polyxtal 
     16   examples.phase.polyxtalCoupled 
    1517 
  • trunk/examples/phase/quaternary.py

    r5268 r5300  
    3333 ## 
    3434 
    35 r"""  
     35r""" Solve a phase-field evolution and diffusion of four species in one-dimension. 
     36 
    3637The same procedure used to construct the two-component phase field 
    3738diffusion problem in :mod:`examples.phase.binary` can be used to build up a 
  • trunk/examples/phase/simple.py

    r5140 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a phase-field (Allen-Cahn) problem in one-dimension. 
    3636 
    3737To run this example from the base FiPy directory, type 
  • trunk/examples/phase/test.py

    r5215 r5300  
    4646                                       'simple', 
    4747                                       'symmetry', 
    48                                        'binaryCoupled' 
     48                                       'binaryCoupled', 
     49                                       'polyxtal', 
     50                                       'polyxtalCoupled' 
    4951                                   ),  
    5052                                   base = __name__) 
  • trunk/examples/reactiveWetting/liquidVapor1D.py

    r5287 r5300  
    3333 ## 
    3434 
    35 r""" 
     35r"""Solve a single-component, liquid-vapor, van der Waals system. 
    3636 
    3737This example solves a single-component, liquid-vapor, van der Waals system as 
  • trunk/examples/updating/update0_1to1_0.py

    r5140 r5300  
    3131 ## 
    3232 
    33 r""" 
     33r"""How to update scripts from version 0.1 to 1.0. 
    3434 
    3535It seems unlikely that many users are still running :term:`FiPy` 0.1, but for those 
     
    9191>>> from fipy.boundaryConditions.fixedFlux import FixedFlux 
    9292>>> boundaryConditions = ( 
    93 ...     FixedValue(mesh.facesLeft, valueLeft), 
    94 ...     FixedValue(mesh.facesRight, valueRight), 
    95 ...     FixedFlux(mesh.facesTop, 0.), 
    96 ...     FixedFlux(mesh.facesBottom, 0.) 
     93...     FixedValue(mesh.getFacesLeft(), valueLeft), 
     94...     FixedValue(mesh.getFacesRight(), valueRight), 
     95...     FixedFlux(mesh.getFacesTop(), 0.), 
     96...     FixedFlux(mesh.getFacesBottom(), 0.) 
    9797...     ) 
    9898 
     
    162162 
    163163>>> axis = 0 
    164 >>> x = mesh.cellCenters[:,axis] 
     164>>> x = mesh.getCellCenters()[:,axis] 
    165165>>> from fipy.tools import numerix 
    166166>>> CC = 1. - numerix.exp(-convCoeff[axis] * x / diffCoeff) 
     
    228228>>> from fipy.boundaryConditions.fixedValue import FixedValue 
    229229>>> boundaryConditions = ( 
    230 ...     FixedValue(mesh.facesLeft, valueLeft), 
    231 ...     FixedValue(mesh.facesRight, valueRight)) 
     230...     FixedValue(mesh.getFacesLeft(), valueLeft), 
     231...     FixedValue(mesh.getFacesRight(), valueRight)) 
    232232 
    233233The creation of the solution variable is unchanged: 
  • trunk/examples/updating/update1_0to2_0.py

    r4152 r5300  
    5656 * The dimension axis of a :class:`~fipy.variables.variable.Variable` is now first, not last 
    5757    
    58    >>> x = mesh.cellCenters[0] 
    59  
    60    instead of 
    61     
    62    >>> x = mesh.cellCenters[...,0] 
     58   >>> x = mesh.getCellCenters()[0] 
     59 
     60   instead of 
     61    
     62   >>> x = mesh.getCellCenters()[...,0] 
    6363        
    6464   This seemingly arbitrary change simplifies a great many things in :term:`FiPy`, but 
    6565   the one most noticeable to the user is that you can now write 
    6666    
    67    >>> x, y = mesh.cellCenters 
     67   >>> x, y = mesh.getCellCenters() 
    6868   
    6969   instead of 
    7070    
    71    >>> x = mesh.cellCenters[...,0] 
    72    >>> y = mesh.cellCenters[...,1] 
     71   >>> x = mesh.getCellCenters()[...,0] 
     72   >>> y = mesh.getCellCenters()[...,1] 
    7373 
    7474   Unfortunately, we cannot reliably automate this conversion, but we find that 
     
    111111      manipulate them, such as 
    112112       
    113       >>> phase.faceGrad.dot((( 0, 1), 
     113      >>> phase.getFaceGrad().dot((( 0, 1), 
    114114      ...                          (-1, 0))) 
    115115 
    116116      instead of the hackish 
    117117       
    118       >>> phase.faceGrad._take((1, 0), axis=1) * (-1, 1) 
     118      >>> phase.getFaceGrad()._take((1, 0), axis=1) * (-1, 1) 
    119119 
    120120 * For internal reasons, :term:`FiPy` now supports  
     
    138138   instead of a list of :class:`~fipy.meshes.face.Face` IDs. Now you write 
    139139    
    140    >>> X, Y = mesh.faceCenters 
    141    >>> FixedValue(faces=mesh.exteriorFaces & (X**2 < 1e-6), value=...) 
    142         
    143    instead of 
    144     
    145    >>> exteriorFaces = mesh.exteriorFaces 
    146    >>> X = exteriorFaces.centers[...,0] 
     140   >>> X, Y = mesh.getFaaceCenters() 
     141   >>> FixedValue(faces=mesh.getExteriorFaces() & (X**2 < 1e-6), value=...) 
     142        
     143   instead of 
     144    
     145   >>> exteriorFaces = mesh.getExteriorFaces() 
     146   >>> X = exteriorFaces.getCenters()[...,0] 
    147147   >>> FixedValue(faces=exteriorFaces.where(X**2 < 1e-6), value=...) 
    148148        
     
    153153   space and on the current values of any other :class:`~fipy.variables.variable.Variable`. 
    154154    
    155    >>> FixedValue(faces=(mesh.exteriorFaces  
     155   >>> FixedValue(faces=(mesh.getExteriorFaces()  
    156156   ...                   & (((X**2 < 1e-6)  
    157157   ...                       & (Y > 3.))  
    158    ...                      | (phi.arithmeticFaceValue  
    159    ...                         < sin(gamma.arithmeticFaceValue)))), value=...) 
     158   ...                      | (phi.getArithmeticFaceValue() 
     159   ...                         < sin(gamma.getArithmeticFaceValue())))), value=...) 
    160160 
    161161   although it probably could have been done with a rather convoluted (and 
     
    178178   ...     initialArray[cell.ID] = 1. 
    179179 
    180    Although they still exist, we find very lille cause to ever call 
     180   Although they still exist, we find very little cause to ever call 
    181181   :meth:`~fipy.meshes.mesh.Mesh.getCells`  
    182182   or :meth:`fipy.meshes.mesh.Mesh.getFaces`. 
  • trunk/examples/updating/update2_0to3_0.py

    r4971 r5300  
    7070   .. note:: the old behavior can be obtained, at least for now, by setting  
    7171             the :envvar:`FIPY_INCLUDE_NUMERIX_ALL` environment variable. 
     72              
     73 * If your equation contains a :class:`~fipy.terms.transientTerm.TransientTerm`, 
     74   then you must specify the timestep by passing a ``dt=`` argument when calling 
     75   :meth:`~fipy.terms.term.Term.solve` or :meth:`~fipy.terms.term.Term.sweep`. 
    7276    
     77The remaining changes are not *required*, but they make scripts easier to read 
     78and we recommend them. :term:`FiPy` may issue a :exc:`DeprecationWarning` for some cases, 
     79to indicate that we may not maintain the old syntax indefinitely. 
     80 
     81 * "getter" and "setter" methods have been replaced with properties, e.g., use 
     82  
     83   >>> x, y = mesh.cellCenters 
     84    
     85   instead of 
     86    
     87   >>> x, y = mesh.getCellCenters() 
     88    
     89 * Boundary conditions are better applied with the 
     90   :meth:`~fipy.variables.cellVariable.CellVariable.constrain` method than with 
     91   the old :class:`~fipy.boundaryConditions.fixedValue.FixedValue` and 
     92   :class:`~fipy.boundaryConditions.fixedFlux.FixedFlux` classes. See 
     93   :ref:`BoundaryConditions`. 
     94   
     95 * Individual :class:`~fipy.meshes.mesh.Mesh` classes should be imported 
     96   directly from :mod:`fipy.meshes` and not :mod:`fipy.meshes.numMesh`. 
     97    
     98 * The :term:`Gmsh` meshes now have simplified names: 
     99   :class:`~fipy.meshes.gmshMesh.Gmsh2D` instead of 
     100   :class:`~fipy.meshes.gmshMesh.GmshImporter2D`, 
     101   :class:`~fipy.meshes.gmshMesh.Gmsh3D` instead of 
     102   :class:`~fipy.meshes.gmshMesh.GmshImporter3D`, and 
     103   :class:`~fipy.meshes.gmshMesh.Gmsh2DIn3DSpace` instead of 
     104   :class:`~fipy.meshes.gmshMesh.GmshImporter2DIn3DSpace`. 
     105 
    73106.. _mailing list:         http://www.ctcms.nist.gov/fipy/mail.html 
    74107""" 
Note: See TracChangeset for help on using the changeset viewer.