Other than a change of sign on the ConvectionTerm, I don't see any problem with 
how you wrote your equation.

There's not much to do to debug a seg fault, other than isolate what line of 
code is causing it. Comment out all the lines in your code and successively add 
them until the seg fault occurs.

How big is your mesh? 

If you create a Viewer with U_z, does it look like you think it should from 
your experimental data?

What are the four failures when you run `python setup.py test`? If something 
deeply was wrong, I'd expect many more than 4 failures, but it still might be 
helpful to know.

- Jon

> On Jul 18, 2017, at 4:42 AM, WANG Lingjian <wan...@dc.tohoku.ac.jp> wrote:
> 
> Hello everyone, I am trying to solve a 1D diffusion problem in a shape like 
> the following equation using FiPy.  Where U(z) is a 1D potential fitted from 
> experiment data. I created this U_z as a CellVariable like the following: ``` 
> U_z = CellVariable(name="potential", mesh=mesh) 
> U_z.setValue(fitted_function(x) * D * beta) ``` >From my understanding, this 
> equation can be interpreted using FiPy syntax as ``` F_z = U_z.faceGrad eqX = 
> TransientTerm() == (DiffusionTerm(coeff=D) + ConvectionTerm(coeff=F_z)) ``` 
> But when I try to solve it using commands that look like this, ``` for step 
> in range(steps): eqX.solve(var=phi, dt=timeStepDuration) print "time step at 
> {}".format(step) viewer.plot() ``` I encounter a Segmentation fault error 
> with no further information indicating any possible error. Could anyone tell 
> me: #1 Is there any misunderstanding in the above processes(i.e. treating the 
> dU/dz term as a ConvectionTerm, using .faceGrad ...)? #2 Is there any option 
> for debugging the !
 Segmentation fault error? Thanks in advance. In case that software environment 
issue, I provide some system information and FiPy test information below. 
[SYSTEM INFO] System: fedora17(Beefy Miracle) Python version: anaconda2 4.4.0 
FiPy installation method: "conda create --name MYFIPYENV --channel guyer 
--channel conda-forge fipy" . [FiPy test status] Testing of FiPy using ``` 
python -c "import fipy; fipy.test()" ``` Fails with AttributeError: 'module' 
object has no attribute 'testFiPy'. But test using ``` python setup.py test ``` 
under the FiPy source folder gives ############### FAILED (failures=4) 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
Skipped 45 doctest examples because neither `lsmlib` nor `skfmm` can be found 
on the $PATH Skipped 2 doctest examples because `lsmlib` must be used to run 
some tests Skipped 1 doctest examples because `skfmm` must be used to run some 
tests ############### _____________________________________________!
 __
> 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 ]

Reply via email to