viewers not found

2014-06-19 Thread Benny Malengier
Hi,

If I run from the build directory, I obtain a
  File /home/benny/git/fipy/fipy/viewers/__init__.py, line 133, in Viewer
raise ImportError, No viewers found. Run `python setup.py egg_info` or
similar.

It seems it is needed to do

python setup.py build egg_info

mv FiPy.egg-info build/lib.linux-x86_64-2.7/

where last dir is changed to your actually build dir

After that fipy is usable via PYTHONPATH, eg

PYTHONPATH=/home/benny/git/fipy/build/lib.linux-x86_64-2.7/ python main.py

I don't like to run the install command myself when working from git. As
the egg_info command adds the egg dir to fipy directory, and not build
directory, is it assumed you should use PYTHONPATH from the git dir itself,
so

PYTHONPATH=/home/benny/git/fipy/ python main.py

which works then? I don't like that that creates all the .pyc files to the
git tree.
Perhaps this could be added INSTALLATION.txt ?

Greetings,
Benny
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: viewers not found

2014-06-19 Thread Benny Malengier
2014-06-19 16:44 GMT+02:00 Daniel Wheeler daniel.wheel...@gmail.com:

 Benny,

 Good to hear from you. Did you try python setup.py develop? This
 allows you to develop on an installed version of a python package. No
 need to mess with PYTHONPATH.

 Cheers,

 Daniel

 On Thu, Jun 19, 2014 at 8:56 AM, Benny Malengier
 benny.maleng...@gmail.com wrote:
  Hi,
 
  If I run from the build directory, I obtain a
File /home/benny/git/fipy/fipy/viewers/__init__.py, line 133, in
 Viewer
  raise ImportError, No viewers found. Run `python setup.py egg_info`
 or
  similar.
 
  It seems it is needed to do
 
  python setup.py build egg_info

 It is a bit odd that the viewers need that, but python setup.py
 develop should deal with any issues like that if you are hacking
 FiPy.


Thanks for the tip, was not aware of it.

Benny


 --
 Daniel Wheeler
 ___
 fipy mailing list
 fipy@nist.gov
 http://www.ctcms.nist.gov/fipy
   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


question on source term

2014-06-19 Thread Benny Malengier
Hi,

another question. This time on SourceTerm use. I'm checking an article with
diffusion and reaction. So some species diffuse, others only react (waiting
for diffused species to start). If there is an example with this floating
on the internet, do point it my way!

You then have a coupled set of equations, of which one of the non diffusive
species will have equation like

eqn3 = TransientTerm(var=P0) == ImplicitSourceTerm(-k3*M1, var=P0) +
ImplicitSourceTerm(-k5*M2, var=P0)


eqn4 = TransientTerm(var=P1) == ImplicitSourceTerm(k3*P0, var=M1)


M1 will have another equation that has a diffusionterm.

In eqn3 it is normal to use ImplicitSourceTerm as the rhs has -k3 M1 P0.

In eqn4, we could actually write


eqn4 = TransientTerm(var=P1) == k3*P0*M1


or


eqn4 = TransientTerm(var=P1) == ImplicitSourceTerm(k3*M1, var=P0)


In light that all will be coupled in one equation to solve, will this lead
to different solutions? Or will fipy internally all give this the same
matrix formulation?


Also, in eqn3, the first term in rhs is actually -k3 M1 P0. It seems nicest
if somehow it is guaranteed that values as in eqn4 for this term would be
used. Will this be the case in this formulation?

Perhaps there is a way to do this nicer and introduce a helper variable,
U=M1*P0, so as to have only in eqn3 and eqn4 ImplicitSourceTerm(-k3, var=U)
and ImplicitSourceTerm(k3, var=U) respectively. If so, how to go about to
do this. If I do ImplicitSourceTerm(-k3, var=M1*P0) I get immediately the
error

fipy.terms.SolutionVariableNumberError: Different number of solution
variables and equations.


So, I would need an equation for U, would that be

eqnhelper = ImplicitSourceTerm(1, var=U) == M1*P0

Or am I making things too complicated now.


Thanks!

Benny
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]