Hi Lafras, I have never tried this, but I think the issue will be the same as for a first order transient term with higher order discretization, which is that we only have two layers of storage for each variable. I'm not sure how difficult that would be. At a minimum you would have to be able to do "var.getOld().getOld()" for a second order term. The CellVariable might need to take a "storageLayers=X" integer instead of having a "hasOld=True" instead. I'm just thinking about the interface.
As far as the actual term, the "self.coeffVectors" variable in CellTerm.py should probably include an array of old variables and not just one value variable as it currently does. The particular cell term, whatever that is, will have a number of old values requirement and that should trigger the CellVariable that is passed in on the first pass through to have that number of old values. That might get around the issue of having to separately tell the CellVariable about how many layers of old values it needs to remember. Most of this stuff can happen recursively. Also, obviously the particular transient term can contain the details of the discretization using a tuple of values. Actually we can do away with the "old value" and "new value" in "self.coeffVectors" and just have a tuple of values. The number of layers would be known from the length of the tuple. Actually that would be in self.weight in TransientTerm. Instead of having 'old value' and 'new value', you could just have 'transient values' and have a tuple of values. "_buildMatrixPy' in CellTerm could then just iterate over the tuple or something. Hope this helps with some ideas. Cheers P.S. I realize that old values and new values are different (one goes on the diagonal and the other on the b vector), so the tuple would just be part of old values. On Fri, Jan 15, 2010 at 1:51 AM, Lafras Uys <[email protected]> wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I'm trying to solve the Euler-Bernoulli beam equation with time > dependent loading. For this I need a second order TransientTerm. One > possible way would be to use the Taylor polynomial to find a quadratic > approximation. My question is: what would be the best way in FiPy to > implement a second order TransientTerm? > > Much obliged, > > Lafras > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAktQDi4ACgkQKUpCd+bV+kr+cACdFmNp1HRjvLqD2BcNGf1m8UjX > 4BoAn10mb09OenM49kUUBDIpcuvlDRfM > =+P/R > -----END PGP SIGNATURE----- > > -- Daniel Wheeler
