On Mon, Aug 25, 2014 at 11:40 AM, Ronghai Wu <ronghai...@fau.de> wrote:

>  Hi Daniel,
> Thanks for your reply anyway.
> Since Fipy is applicable to phase-field and stress-strain coupled problem,
> I plan to use Sfepy to calculate stress-strain, then use the result for
> phase-field calculation. However, as the mesh numbering rules of Sfepy and
> Fipy are not the same, the order of stress values in outcome Sfepy array is
> not as expected for Fipy. So, I think ,if I could export Fipy mesh, then
> use it in Sfepy for calculating stree-strain, then use the outcome Sfepy
> stress -strain in Fipy, would be very convenient.
>
Regarding this issue do you have any good idea?
>

I have been using SfePy to do stress/strain calculations as well, but I
haven't linked it with FiPy. However, in FiPy you can easily pull out the
values of a field at various locations in the mesh.


    import fipy as fp
    m = fp.Grid2D(nx=100, ny=100, dx=0.1, dy=0.1)
    v = fp.CellVariable(mesh=m, value=m.x * m.y)
    X = np.random.random((2, 5))
    v(X, order=1)
    Out: array([ 0.02970365,  0.23925287,  0.09022034,  0.1256531 ,
0.5833762 ])
    X[0] * X[1]
    Out: array([ 0.01097054,  0.23876274,  0.08856132,  0.12720232,
0.58384755])

Point being that it is fairly easy to extract the values from FiPy fields
and set the Sfepy field at the given locations (to first order accuracy).
Of course you still need the reverse mapping, but I imagine there is a way
to to do that with SfePy.

Hope that helps.

-- 
Daniel Wheeler
_______________________________________________
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