Hi Clara,

The following changes made it run for me. I turned d2G into a face
variable and K into a variable that is updated in the sweep loop. I
also removed redefining the equation. FiPy's designed so you only need
to to create the equation once. I'm not sure what the values of d2G
correspond to. Which spatial location do they correspond to? Faces or
Cells. I'm assuming faces since there are 1001 of them. Also, this
might need to be adjusted for higher dimensions.

Cheers,

Daniel

~~~~
$ git diff
diff --git a/Spinodal_fipy_FeNi_varT_runs_DEBUG.py
b/Spinodal_fipy_FeNi_varT_runs_DEBUG.py
index 715e79b..a82387e 100644
--- a/Spinodal_fipy_FeNi_varT_runs_DEBUG.py
+++ b/Spinodal_fipy_FeNi_varT_runs_DEBUG.py
@@ -289,20 +289,21 @@ def
Get_spline_Chebnodes(X,N,T0,R,RefFe,RefNi,L0ex,L1ex,L2ex,Tmag,Bmag,p_fcc,A_f
     return d2G


+
 ## THIS IS WHERE I WOULD LIKE TO HAVE A FIPY VARIABLE TYPE FOR d2G.
 d2G = 
Get_spline_Chebnodes(Xf,100,T0,R,RefFe,RefNi,L0ex,L1ex,L2ex,Tmag,Bmag,p_fcc,A_fcc,Nv,Na)*1.0e-9
-
+d2G_var = FaceVariable(mesh=mesh, value=d2G)

 ## Initial diffusion coefficient
-Diff = Mob*d2G
+Diff = Mob*d2G_var


 ## Initial gradient energy (depending on the interfacial energy we want)
 K = 2.0*kappa[id_mean_spino]
-
+K_var = Variable(K)

 ## Initial equation
-eq = TransientTerm(coeff=1.) == DiffusionTerm(Diff) -
DiffusionTerm(coeff=(Mob, K))
+eq = TransientTerm(coeff=1.) == DiffusionTerm(Diff) -
DiffusionTerm(coeff=(Mob, K_var))


 plt.figure(figsize=(8,6))
@@ -390,16 +391,16 @@ while time < duration:
     Mob = M[step_T][id_mean_T]

     d2G = 
Get_spline_Chebnodes(Xf,100,T_spino[step_T],R,RefFe,RefNi,L0ex,L1ex,L2ex,Tmag,Bmag,p_fcc,A_fcc,Nv,Na)*1.0e-9
-
-    Diff = Mob*d2G
+    d2G_var[:] = d2G

     K = 2.0*kappa[step_T]
+    K_var.setValue(K)
     print 'Mob, Diff, K'
     print Mob, Diff, K
     print 'MAX CONCENTRATION'
     print max(X_var)

-    eq = TransientTerm(coeff=1.) == DiffusionTerm(Diff) -
DiffusionTerm(coeff=(Mob, K))
+


 print datetime.now() - startTime
(END)
~~~~

On Thu, Jan 11, 2018 at 2:35 PM, Clara Maurel <cmau...@mit.edu> wrote:
> Hi Daniel,
>
> Thank you for taking the time to look at this! My main code calls several
> text files and subroutine. I attach everything that is needed to run the
> code:

-- 
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