Re: Remeshing and code speedup

2018-07-24 Thread Carsten Langrock
Thanks for the links. I had come across the first one, but I haven’t found any 
major speedup using the —inline option on this 1D problem. Initially I thought 
that remeshing would be fairly simple, not unlike what our C++ code does. It 
wouldn’t speed things up necessarily since our code uses a constant number of 
points, but it would increase the accuracy since you are reducing the 
computational window to only contain areas with non-zero concentration (in the 
case of a diffusion problem).


>From the response by the maintainers of FiPy it would seem that this isn’t as 
>straightforward as I thought. I’ll give it another go, though, and would 
>report back if it works. The overhead might be pretty large, let’s see.


Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_





> On Jul 24, 2018, at 9:19 AM, Drew Davidson  wrote:
> 
> 
> Hi Carsten,
> 
> Have you looked at:
> 
> 
> https://www.ctcms.nist.gov/fipy/documentation/EFFICIENCY.html
> 
> 
> 
> 
> http://nbviewer.jupyter.org/github/wd15/fipy-efficiency/blob/master/notebooks/FiPy-IPython.ipynb
> 
> 
> 
> 
> https://www.mail-archive.com/fipy@nist.gov/msg03180.html
>   thread
> 
> 
> 
> I struggled to install weave and get --inline working.  I didn't use it much 
> yet, but my initial impression was the speedup was modest.
> 
> 
> Remeshing seems like a great possibility for making problems such as 
> examples.phase.anisotropy run faster (use higher mesh density at the 
> interface), but I am afraid that FiPy architecture (lazy evaluation etc) 
> could interfere.  I hope you share what you find with remeshing.
> 
> 
> Thanks
> 
> 
> On Tue, Jul 24, 2018 at 10:56 AM Carsten Langrock > wrote:
> 
>> 
>> Thanks for pointing out the performance order of the solvers. I’ll try to 
>> get pySparse to work to compare it other solvers. It’s also good to know 
>> that I shouldn’t give up on 2D just yet;-)
>> 
>> 
>> Regards,
>> Carsten
>> 
>> 
>> _Dipl.-Phys. Carsten Langrock, Ph.D.
>> 
>> Senior Research Scientist
>> Edward L. Ginzton Laboratory, Rm. 202
>> Stanford University
>> 
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> 
>> Tel. (650) 723-0464
>> Fax (650) 723-2666
>> 
>> Ginzton Lab Shipping Address:
>> James and Anna Marie Spilker Engineering and Applied Sciences Building
>> 04-040
>> 
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> _
>> 
>> 
>> 
>> 
>> 
>>> On Jul 24, 2018, at 6:11 AM, Guyer, Jonathan E. Dr. (Fed) 
>>> >>> wrote:
>>> 
>>> 
>>> FiPy still does not support remeshing. 
>>> 
>>> 
>>> As Dario said, choice of solver can make a big difference. I've not used 
>>> PyAMG much, but PySparse is dramatically faster than SciPy. PyTrilinos is 
>>> slower than PySparse, but enables you to solve in parallel.
>>> 
>>> 
>>> I've also found that 2D problems solve much better than the 1D performance 
>>> would lead you to believe. There's just a lot of overhead in setting up the 
>>> problem and the Python communication with the lower-level libraries.
>>>> 
>>>> 
>>>> On Jul 23, 2018, at 6:44 PM, Carsten Langrock >>>> wrote:
>>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> Thanks for the help with getting FiPy running under Linux! I am trying to 
>>>> re-create a 1D nonlinear diffusion problem for which we have C++ code that 
>>>> uses the implicit Thomas algorithm based on 
>>>> 
>>>> 
>>>> J. Weickert, B. Romerny, M. Viergever, "Efficient and Reliable Schemes
>>>> for Nonlinear Diffusion Filtering”, IEEE transactions on Image Processing, 
>>>> vol.7, N03, page 398, March 1998
>>>> 
>>>> 
>>>> I have been able to get results in FiPy that match this code very closely 
>>>> which was a great start. Our C++ code uses a fixed number of spatial 
>>>> points and a fixed time step, but re-meshes space to most efficiently use 
>>>> the size of the array; it increases the

Re: Remeshing and code speedup

2018-07-24 Thread Carsten Langrock
I tried a few solvers for this 1D diffusion problem and it does indeed appear 
that pySparse is faster than the rest. Sadly, faster doesn’t equate to fast … 
about 4 seconds for a 2000 grid, 440 time steps nonlinear diffusion process 
using a single sweep. For the second part, which opens the left boundary and 
forces it to zero, it takes another 9.5 seconds when choosing 3 sweeps. And 
that’s on a fast computer.


Thanks again for pointing out the use of different solvers.


Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_





> On Jul 24, 2018, at 6:11 AM, Guyer, Jonathan E. Dr. (Fed) 
>  wrote:
> 
> 
> FiPy still does not support remeshing. 
> 
> 
> As Dario said, choice of solver can make a big difference. I've not used 
> PyAMG much, but PySparse is dramatically faster than SciPy. PyTrilinos is 
> slower than PySparse, but enables you to solve in parallel.
> 
> 
> I've also found that 2D problems solve much better than the 1D performance 
> would lead you to believe. There's just a lot of overhead in setting up the 
> problem and the Python communication with the lower-level libraries.
>> 
>> 
>> On Jul 23, 2018, at 6:44 PM, Carsten Langrock  wrote:
>> 
>> 
>> Hi,
>> 
>> 
>> Thanks for the help with getting FiPy running under Linux! I am trying to 
>> re-create a 1D nonlinear diffusion problem for which we have C++ code that 
>> uses the implicit Thomas algorithm based on 
>> 
>> 
>> J. Weickert, B. Romerny, M. Viergever, "Efficient and Reliable Schemes
>> for Nonlinear Diffusion Filtering”, IEEE transactions on Image Processing, 
>> vol.7, N03, page 398, March 1998
>> 
>> 
>> I have been able to get results in FiPy that match this code very closely 
>> which was a great start. Our C++ code uses a fixed number of spatial points 
>> and a fixed time step, but re-meshes space to most efficiently use the size 
>> of the array; it increases the spatial step size by 2 whenever the 
>> concentration at a particular point reaches a set threshold. I tried 
>> implementing this in FiPy as well, but haven’t had much luck so far. I saw 
>> an old mailing-list entry from 2011 where a user was told that FiPy wasn’t 
>> meant to do remeshing. Is that still the case?
>> 
>> 
>> I’d imagine one would somehow need to update the Grid1D object with the new 
>> ‘dx’, but since the CellVariable that holds the solution was initialized 
>> with that mesh object, I am not sure that such a change would propagate in a 
>> sensible fashion. I think I know how to map the value of the CellVariable to 
>> account for the change in ‘dx’ by 
>> 
>> 
>> array_size = 2000
>> phi.value = numpy.concatenate((phi.value[1:array_size/2:2], 
>> numpy.zeros(1500)))
>> 
>> 
>> for the case when the initial variable holds 2000 spatial points. Maybe 
>> there’s a more elegant way, but I think this works in principle.
>> 
>> 
>> Another question would be execution speed. Right now, even when not plotting 
>> the intermediate solutions, it takes many seconds on a very powerful 
>> computer to run a simple diffusion problem. I am probably doing something 
>> really wrong. I wasn’t expecting the code to perform as well as the C++ 
>> code, but I had hoped to come within an order of magnitude. Are there ways 
>> to optimize the performance? Maybe select a particularly clever solver? If 
>> someone could point me into the right direction that’d be great. In the end, 
>> I would like to expand the code into 2D, but given the poor 1D performance, 
>> I don’t think that this would be feasible at this point.
>> 
>> 
>> Thanks,
>> Carsten
>> 
>> 
>> _
>> Dipl.-Phys. Carsten Langrock, Ph.D.
>> 
>> 
>> Senior Research Scientist
>> Edward L. Ginzton Laboratory, Rm. 202
>> Stanford University
>> 
>> 
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> 
>> 
>> Tel. (650) 723-0464
>> Fax (650) 723-2666
>> 
>> 
>> Ginzton Lab Shipping Address:
>> James and Anna Marie Spilker Engineering and Applied Sciences Building
>> 04-040
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> _
>

Re: Remeshing and code speedup

2018-07-24 Thread Carsten Langrock
Thanks for pointing out the performance order of the solvers. I’ll try to get 
pySparse to work to compare it other solvers. It’s also good to know that I 
shouldn’t give up on 2D just yet;-)


Regards,
Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_





> On Jul 24, 2018, at 6:11 AM, Guyer, Jonathan E. Dr. (Fed) 
>  wrote:
> 
> 
> FiPy still does not support remeshing. 
> 
> 
> As Dario said, choice of solver can make a big difference. I've not used 
> PyAMG much, but PySparse is dramatically faster than SciPy. PyTrilinos is 
> slower than PySparse, but enables you to solve in parallel.
> 
> 
> I've also found that 2D problems solve much better than the 1D performance 
> would lead you to believe. There's just a lot of overhead in setting up the 
> problem and the Python communication with the lower-level libraries.
>> 
>> 
>> On Jul 23, 2018, at 6:44 PM, Carsten Langrock  wrote:
>> 
>> 
>> Hi,
>> 
>> 
>> Thanks for the help with getting FiPy running under Linux! I am trying to 
>> re-create a 1D nonlinear diffusion problem for which we have C++ code that 
>> uses the implicit Thomas algorithm based on 
>> 
>> 
>> J. Weickert, B. Romerny, M. Viergever, "Efficient and Reliable Schemes
>> for Nonlinear Diffusion Filtering”, IEEE transactions on Image Processing, 
>> vol.7, N03, page 398, March 1998
>> 
>> 
>> I have been able to get results in FiPy that match this code very closely 
>> which was a great start. Our C++ code uses a fixed number of spatial points 
>> and a fixed time step, but re-meshes space to most efficiently use the size 
>> of the array; it increases the spatial step size by 2 whenever the 
>> concentration at a particular point reaches a set threshold. I tried 
>> implementing this in FiPy as well, but haven’t had much luck so far. I saw 
>> an old mailing-list entry from 2011 where a user was told that FiPy wasn’t 
>> meant to do remeshing. Is that still the case?
>> 
>> 
>> I’d imagine one would somehow need to update the Grid1D object with the new 
>> ‘dx’, but since the CellVariable that holds the solution was initialized 
>> with that mesh object, I am not sure that such a change would propagate in a 
>> sensible fashion. I think I know how to map the value of the CellVariable to 
>> account for the change in ‘dx’ by 
>> 
>> 
>> array_size = 2000
>> phi.value = numpy.concatenate((phi.value[1:array_size/2:2], 
>> numpy.zeros(1500)))
>> 
>> 
>> for the case when the initial variable holds 2000 spatial points. Maybe 
>> there’s a more elegant way, but I think this works in principle.
>> 
>> 
>> Another question would be execution speed. Right now, even when not plotting 
>> the intermediate solutions, it takes many seconds on a very powerful 
>> computer to run a simple diffusion problem. I am probably doing something 
>> really wrong. I wasn’t expecting the code to perform as well as the C++ 
>> code, but I had hoped to come within an order of magnitude. Are there ways 
>> to optimize the performance? Maybe select a particularly clever solver? If 
>> someone could point me into the right direction that’d be great. In the end, 
>> I would like to expand the code into 2D, but given the poor 1D performance, 
>> I don’t think that this would be feasible at this point.
>> 
>> 
>> Thanks,
>> Carsten
>> 
>> 
>> _
>> Dipl.-Phys. Carsten Langrock, Ph.D.
>> 
>> 
>> Senior Research Scientist
>> Edward L. Ginzton Laboratory, Rm. 202
>> Stanford University
>> 
>> 
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> 
>> 
>> Tel. (650) 723-0464
>> Fax (650) 723-2666
>> 
>> 
>> Ginzton Lab Shipping Address:
>> James and Anna Marie Spilker Engineering and Applied Sciences Building
>> 04-040
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> _
>> ___
>> 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 ]
> 
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: Remeshing and code speedup

2018-07-24 Thread Carsten Langrock
Dario,


Thanks. I was able to install the PyAmg module and use it by adding —pyamg on 
the command line. The DefaultSolver on my system appears to be PyTrilinos. 
Sadly, with the —pyamg flag, it took significantly longer for the script to run 
… and I haven’t yet been able to get pySparse to work; or make the —inline flag 
go, for that matter. I’ll check on another machine later. 


Thanks for the help,
Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_





> On Jul 24, 2018, at 2:32 AM, Dario Panada  wrote:
> 
> 
> Hi Carsten,
> 
> I'll start by saying I'm not a fipy expert, but have been playing around it 
> for a few months as part of my PhD project.
> 
> 
> Regarding your second question.
> 
> 
> Performance can be improved by switching from the default (SciPy) solver to 
> one of the others. I use the PyAmg solver that can solve a 100x100x100 3D 
> mesh with multiple sources and sinks in about 1 minute. I am not running a 
> particularly powerful computer, just my laptop with 8GB of RAM (about half of 
> which taken up by the OS, Browser and IntelliJ), so you could probably get 
> even better performance.
> 
> 
> Hope this is at least somewhat helpful. :)
> 
> 
> Kind Regards,
> Dario
> 
> 
> On Tue, Jul 24, 2018 at 12:44 AM Carsten Langrock > wrote:
> 
>> 
>> Hi,
>> 
>> 
>> Thanks for the help with getting FiPy running under Linux! I am trying to 
>> re-create a 1D nonlinear diffusion problem for which we have C++ code that 
>> uses the implicit Thomas algorithm based on 
>> 
>> 
>> J. Weickert, B. Romerny, M. Viergever, "Efficient and Reliable Schemes
>> for Nonlinear Diffusion Filtering”, IEEE transactions on Image Processing, 
>> vol.7, N03, page 398, March 1998
>> 
>> 
>> 
>> I have been able to get results in FiPy that match this code very closely 
>> which was a great start. Our C++ code uses a fixed number of spatial points 
>> and a fixed time step, but re-meshes space to most efficiently use the size 
>> of the array; it increases the spatial step size by 2 whenever the 
>> concentration at a particular point reaches a set threshold. I tried 
>> implementing this in FiPy as well, but haven’t had much luck so far. I saw 
>> an old mailing-list entry from 2011 where a user was told that FiPy wasn’t 
>> meant to do remeshing. Is that still the case?
>> 
>> 
>> I’d imagine one would somehow need to update the Grid1D object with the new 
>> ‘dx’, but since the CellVariable that holds the solution was initialized 
>> with that mesh object, I am not sure that such a change would propagate in a 
>> sensible fashion. I think I know how to map the value of the CellVariable to 
>> account for the change in ‘dx’ by 
>> 
>> 
>> array_size = 2000
>> phi.value = numpy.concatenate((phi.value[1:array_size/2:2], 
>> numpy.zeros(1500)))
>> 
>> 
>> for the case when the initial variable holds 2000 spatial points. Maybe 
>> there’s a more elegant way, but I think this works in principle.
>> 
>> 
>> Another question would be execution speed. Right now, even when not plotting 
>> the intermediate solutions, it takes many seconds on a very powerful 
>> computer to run a simple diffusion problem. I am probably doing something 
>> really wrong. I wasn’t expecting the code to perform as well as the C++ 
>> code, but I had hoped to come within an order of magnitude. Are there ways 
>> to optimize the performance? Maybe select a particularly clever solver? If 
>> someone could point me into the right direction that’d be great. In the end, 
>> I would like to expand the code into 2D, but given the poor 1D performance, 
>> I don’t think that this would be feasible at this point.
>> 
>> 
>> Thanks,
>> Carsten
>> 
>> 
>> _Dipl.-Phys. Carsten Langrock, Ph.D.
>> 
>> Senior Research Scientist
>> Edward L. Ginzton Laboratory, Rm. 202
>> Stanford University
>> 
>> 348 Via Pueblo Mall
>> 94305 Stanford, CA
>> 
>> Tel. (650) 723-0464
>> Fax (650) 723-2666
>> 
>> Ginzton Lab Shipping Address:
>> James and Anna Marie Spilker Engineering and Applied Sciences Building

Remeshing and code speedup

2018-07-23 Thread Carsten Langrock
Hi,


Thanks for the help with getting FiPy running under Linux! I am trying to 
re-create a 1D nonlinear diffusion problem for which we have C++ code that uses 
the implicit Thomas algorithm based on 


J. Weickert, B. Romerny, M. Viergever, "Efficient and Reliable Schemes
for Nonlinear Diffusion Filtering”, IEEE transactions on Image Processing, 
vol.7, N03, page 398, March 1998



I have been able to get results in FiPy that match this code very closely which 
was a great start. Our C++ code uses a fixed number of spatial points and a 
fixed time step, but re-meshes space to most efficiently use the size of the 
array; it increases the spatial step size by 2 whenever the concentration at a 
particular point reaches a set threshold. I tried implementing this in FiPy as 
well, but haven’t had much luck so far. I saw an old mailing-list entry from 
2011 where a user was told that FiPy wasn’t meant to do remeshing. Is that 
still the case?


I’d imagine one would somehow need to update the Grid1D object with the new 
‘dx’, but since the CellVariable that holds the solution was initialized with 
that mesh object, I am not sure that such a change would propagate in a 
sensible fashion. I think I know how to map the value of the CellVariable to 
account for the change in ‘dx’ by 


array_size = 2000
phi.value = numpy.concatenate((phi.value[1:array_size/2:2], numpy.zeros(1500)))


for the case when the initial variable holds 2000 spatial points. Maybe there’s 
a more elegant way, but I think this works in principle.


Another question would be execution speed. Right now, even when not plotting 
the intermediate solutions, it takes many seconds on a very powerful computer 
to run a simple diffusion problem. I am probably doing something really wrong. 
I wasn’t expecting the code to perform as well as the C++ code, but I had hoped 
to come within an order of magnitude. Are there ways to optimize the 
performance? Maybe select a particularly clever solver? If someone could point 
me into the right direction that’d be great. In the end, I would like to expand 
the code into 2D, but given the poor 1D performance, I don’t think that this 
would be feasible at this point.


Thanks,
Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_




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


Re: Fresh installation ... fipy.test() and diffusion examples fail

2018-07-20 Thread Carsten Langrock


> On Jul 20, 2018, at 7:50 AM, Guyer, Jonathan E. Dr. (Fed) 
>  wrote:
> 
> 
> Our most current notion of how to install is captured 
> [here](https://github.com/usnistgov/fipy/blob/develop/.travis.yml)
> 
> 
> In short, on Mac OS:
> 
> 
> conda create --name  --channel guyer --channel conda-forge 
> python=2.7 fipy weave
> 
> 
> and on linux:
> 
> 
> conda create --name  --channel guyer --channel conda-forge 
> python=2.7 numpy scipy gmsh pysparse mpi4py matplotlib mayavi fipytrilinos 
> weave
> 
> 
> 
> 
> 
> and then for both:
> 
> 
> source activate 
> pip install scikit-fmm
> 
> 
> 

Sadly, following these instructions doesn’t lead to a working installation. 
Importing ‘fipy’ results in 


>>> import fipy

Fatal error in MPI_Init_thread: Other MPI error, error stack:

MPIR_Init_thread(474)..: 

MPID_Init(190).: channel initialization failed

MPIDI_CH3_Init(89).: 

MPID_nem_init(320).: 

MPID_nem_tcp_init(173).: 

MPID_nem_tcp_get_business_card(420): 

MPID_nem_tcp_init(379).: gethostbyname failed, CL (errno 1)

[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=3191311

:

system msg for write_line failure : Bad file descriptor




under macOS. Under Linux, after adding the fipy package to the recommended 
command 


conda create — ame  --channel guyer --channel conda-forge python=2.7 
numpy scipy gmsh pysparse mpi4py matplotlib mayavi fipytrilinos weave



I can import fipy without causing errors (!!!), but run into problems when 
executing fipy.test(). It’s the same gmsh problem, I think, as mentioned by 
Trevor in a previous post. On a positive note, I am now able to execute the 
mesh1d.py file without errors, which is a major step in the right direction. 


Thanks for the help,
Carsten


T


> 
> 
> 
> Windows installations are covered 
> [here](https://github.com/usnistgov/fipy/blob/develop/appveyor.yml), but 
> basically you should be able to do the same as on Mac.
> 
> 
> 
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: Fresh installation ... fipy.test() and diffusion examples fail

2018-07-20 Thread Carsten Langrock
  
  

 Ok, thanks for the information. I’ll try this again using python 2.7.   
  
  
  
  
  
  _   
  Dipl.-Phys. Carsten Langrock,   Ph.D.
  
 Senior Research Scientist
 Edward L. Ginzton Laboratory,   Rm. 202
 Stanford University
  
 348 Via Pueblo Mall
 94305 Stanford, CA
  
 Tel. (650) 723-0464
 Fax (650) 723-2666
  
 Ginzton Lab Shipping Address:
 Astro-Physics Building, Rm. 148
 452 Lomita Mall
  
 Ginzton Lab Freight Deliveries:
 491 South Service Road
 _   
  

  
  
>   
> On Jul 20, 2018 at 06:38,   (mailto:jonathan.gu...@nist.gov)>  wrote:
>   
>   
>   
>  FiPy should be installed with Python 2.7. We are aware that the 
> documentation doesn't say this right now; getting the installation working 
> smoothly and ensuring that all of the documentation describes the process 
> completely and accurately is a non-trivial task.
>
>
> >  On Jul 19, 2018, at 8:02 PM, Carsten Langrock
> > wrote:
> >   
> >  Hi,
> >   
> >  It’s been a while since I tried using the FiPy package. I followed the 
> > installation directions and used miniconda to generate a Python environment 
> > for FiPy. Running the fipy.test() function lists a large number of not 
> > installed packages, some of which I was able to install manually; not sure 
> > why packages tested by FiPy in this function aren’t part of the vanilla 
> > install … Other packages like pysparse don’t seem to want to installed 
> > possibly due to a conflict between Python 2 and 3; I am using the Python 
> > 3.6 version of minconda. There are two references to mpi4py in the test 
> > script. I installed mpi4py, but …
> >   
> >  gist version not available
> >  mpi4py version 3.0.0
> >  mpi4py is not installed
> >   
> >  Not sure what’s going on here and what the difference may be.
> >   
> >  The test() function also crashes the Python interpreter.
> >   
> >  ==
> >  ERROR: testFiPy (unittest.loader._FailedTest)
> >  --
> >  ImportError: Failed to import test module: testFiPy
> >  Traceback (most recent call last):
> >  File 
> > "/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/unittest/loader.py", 
> > line 153, in loadTestsFromName
> >  module = __import__(module_name)
> >  ModuleNotFoundError: No module named ‘fipy.testFiPy'
> >   
> >  Trying to run the first diffusion example
> >   
> >  python examples/diffusion/mesh1D.py
> >   
> >  gives the following error
> >   
> >  Traceback (most recent call last):
> >  File "examples/diffusion/mesh1D.py", line 794, in  
> >  exec(fipy.tests.doctestPlus._getScript())
> >  File "", line 139
> >  the transient diffusion equation"
> >  ^
> >  SyntaxError: Missing parentheses in call to 'print'. Did you mean 
> > print("The SciPy library is not available to test the solution to \
> >  the transient diffusion equation”)?
> >   
> >  I am not familiar with restructured text and how such commented code is 
> > supposed to be run using the ipy.tests.doctestPlus._getScript() function, 
> > but there’s apparently some issue.
> >   
> >  The second example fails differently, which seems to indicate a problem in 
> > the call to splu()
> >   
> >  python examples/diffusion/coupled.py
> >   
> >  
> > /Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/viewers/matplotlibViewer/__init__.py:113:
> >  UserWarning: Matplotlib1DViewer efficiency is improved by setting the 
> > 'datamax' and 'datamin' keys
> >  return Matplotlib1DViewer(vars=vars, title=title, axes=axes, **kwlimits)
> >  Traceback (most recent call last):
> >  File "examples/diffusion/coupled.py", line 153, in  
> >  exec(fipy.tests.doctestPlus._getScript())
> >  File "", line 66, in  
> >  File 
> > "/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/terms/term.py",
> >  line 254, in sweep
> >  solver._solve()
> >  File 
> > "/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/solvers/scipy/scipySolver.py",
> >  line 61, in _solve
> >  self.var[:] = numerix.reshape(self._solve_(self.matrix, self.var.ravel(), 
> > numerix.array(self.RHSvector)), self.var.shape)  
> >  File 
> > "/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/solvers/scipy/linearLUSolver.py

FiPy on Linux

2018-07-19 Thread Carsten Langrock
Hi,


Since the macOS install didn’t result in much, I tried it under Linux. No luck, 
it’s actually even worse. I cannot import fipy without generating errors. It 
appears to hang on


‘Could not import any solver package’


I saw that some reported the same problem but I didn’t see a solution. SciPy is 
installed, of course. This is following the recommended installation modality 
using miniconda.


Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_




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


Fresh installation ... fipy.test() and diffusion examples fail

2018-07-19 Thread Carsten Langrock
Hi,


It’s been a while since I tried using the FiPy package. I followed the 
installation directions and used miniconda to generate a Python environment for 
FiPy. Running the fipy.test() function lists a large number of not installed 
packages, some of which I was able to install manually; not sure why packages 
tested by FiPy in this function aren’t part of the vanilla install … Other 
packages like pysparse don’t seem to want to installed possibly due to a 
conflict between Python 2 and 3; I am using the Python 3.6 version of minconda. 
There are two references to mpi4py in the test script. I installed mpi4py, but …


gist version not available
mpi4py version 3.0.0
mpi4py is not installed



Not sure what’s going on here and what the difference may be.


The test() function also crashes the Python interpreter.


==
ERROR: testFiPy (unittest.loader._FailedTest)
--
ImportError: Failed to import test module: testFiPy
Traceback (most recent call last):
  File 
"/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/unittest/loader.py", 
line 153, in loadTestsFromName
    module = __import__(module_name)
ModuleNotFoundError: No module named ‘fipy.testFiPy'



Trying to run the first diffusion example


python examples/diffusion/mesh1D.py



gives the following error


Traceback (most recent call last):
  File "examples/diffusion/mesh1D.py", line 794, in 
    exec(fipy.tests.doctestPlus._getScript())
  File "", line 139
    the transient diffusion equation"
                                    ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("The 
SciPy library is not available to test the solution to \
the transient diffusion equation”)?



I am not familiar with restructured text and how such commented code is 
supposed to be run using the ipy.tests.doctestPlus._getScript() function, but 
there’s apparently some issue.


The second example fails differently, which seems to indicate a problem in the 
call to splu()


python examples/diffusion/coupled.py



/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/viewers/matplotlibViewer/__init__.py:113:
 UserWarning: Matplotlib1DViewer efficiency is improved by setting the 
'datamax' and 'datamin' keys
  return Matplotlib1DViewer(vars=vars, title=title, axes=axes, **kwlimits)
Traceback (most recent call last):
  File "examples/diffusion/coupled.py", line 153, in 
    exec(fipy.tests.doctestPlus._getScript())
  File "", line 66, in 
  File 
"/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/terms/term.py",
 line 254, in sweep
    solver._solve()
  File 
"/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/solvers/scipy/scipySolver.py",
 line 61, in _solve
    self.var[:] = numerix.reshape(self._solve_(self.matrix, self.var.ravel(), 
numerix.array(self.RHSvector)), self.var.shape)   
  File 
"/Users/langrock/miniconda3/envs/FiPyEnv/lib/python3.6/site-packages/fipy/solvers/scipy/linearLUSolver.py",
 line 64, in _solve_
    permc_spec=3)
TypeError: splu() got an unexpected keyword argument ‘drop_tol'





Anyhow, it’d be nice to at least get the simplest examples to work on my 
machine (macOS 10.13.6). Even following the mesh1D.py example by hand resulted 
in errors at 


eqX.solve(var=phi, dt=timeStepDuration)



The error was the same as the one above referencing the splu() call with an 
unexpected keyword argument ‘drop_tol’.


Thanks,
Carsten


  _Dipl.-Phys. Carsten Langrock, Ph.D.

Senior Research Scientist
Edward L. Ginzton Laboratory, Rm. 202
Stanford University

348 Via Pueblo Mall
94305 Stanford, CA

Tel. (650) 723-0464
Fax (650) 723-2666

Ginzton Lab Shipping Address:
James and Anna Marie Spilker Engineering and Applied Sciences Building
04-040

348 Via Pueblo Mall
94305 Stanford, CA
_




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


Fresh installation tests fail

2017-05-16 Thread Carsten Langrock
Following installation guide using conda under macOS 10.12.5, I am not able to 
run the fipy.test() function without it throwing an exception. The output is 
listed below. Any hint on how to solve this would be appreciated.

Python 2.7.13 | packaged by conda-forge | (default, May  2 2017, 13:29:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fipy
>>> fipy.test()
running egg_info
creating 
/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info
writing 
/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/PKG-INFO
writing top-level names to 
/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/top_level.txt
writing dependency_links to 
/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/dependency_links.txt
writing manifest file 
'/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
reading manifest file 
'/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
writing manifest file 
'/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
running test
running build_ext
fipy version 3.1.3
numpy version 1.10.4
pysparse version 1.3-dev
scipy version 0.17.1
matplotlib version 2.0.0
gist is not installed
mpi4py version 2.0.0
Trilinos version: 11.10.2
PyTrilinos version: 4.10d
mayavi version 4.5.0
gmsh version 2.15.0
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/fipy/__init__.py",
 line 164, in test
    cmdclass={'test': _TestClass(_test)})
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/core.py", line 
151, in setup
    dist.run_commands()
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/dist.py", line 
953, in run_commands
    self.run_command(cmd)
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/dist.py", line 
972, in run_command
    cmd_obj.run()
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/setuptools/command/test.py",
 line 211, in run
    self.run_tests()
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/fipy/tests/testClass.py",
 line 236, in run_tests
    testLoader = loader_class()
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py", line 
94, in __init__
    self.parseArgs(argv)
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py", line 
149, in parseArgs
    self.createTests()
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py", line 
158, in createTests
    self.module)
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/loader.py", 
line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File 
"/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/loader.py", 
line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'testFiPy'


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