Hello All,

I have two questions that I'm hoping you may be able to help me with.

Firstly, the FiPy code I'm working with sweeps for four inter-dependent 
CellVariables / PDEs in a loop until their residuals falls below specified 
tolerances. After profiling the code, it's clear that this sweeping process 
accounts for ~95% of the time spent solving in a given timestep. Consequently, 
advancing in time is painfully slow. Assuming that the CellVariable tolerances 
are fixed at their largest allowable values, what would be the best strategy 
for me to take to reduce the time spent sweeping these variables?

Secondly, some (but not all) of the boundary conditions for these four PDEs 
need to be updated between sweeping one CellVariable and the next. Notably, 
this is within a single timestep because the boundary conditions are functions 
of the CellVariables being swept. What is the recommended approach for updating 
the values of these boundary conditions, and why? At present, the following is 
the approach used: define the boundary condition only within the loop using 
x.constrain(value, where=some_boundary). i.e. the boundary condition is 
re-defined with new variables at every pass through the loop.

However, I suspect that this approach may be incorrect, and that a better 
approach may be to define the boundary conditions only once, outside of the 
loop, and to update them by employing the .value approach for CellVariables. I 
am at a loss to understand why this approach may be better, though.

With best regards,


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