freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pooma-dev] Re: [PATCH] Fix PrintField wrt expressions


From: Jeffrey D. Oldham
Subject: Re: [pooma-dev] Re: [PATCH] Fix PrintField wrt expressions
Date: Fri, 16 Jan 2004 09:06:00 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Richard Guenther wrote:
On Thu, 15 Jan 2004, Jeffrey D. Oldham wrote:


Richard Guenther wrote:

Hi!

The following patch allows to print Fields with expression engines.
PrintField uses applyRelations() while it should use a tree-walk with
PerformUpdateTag.

So, with this change, the field will be guaranteed to be updated by any
relations that can change the field?


If the field is dirty, yes.  Behavoir is exactly the same as before, just
the case

  tester.out() << f + 1.0 << std::endl;

didn't work before, because the FieldEngine<ExpressionEngine> doesn't have
the data() method applyRelations is trying to access.  The forEach()
magically skips the ExpressionEngines and applies to the leafs only.

Richard.


2004Jan14  Richard Guenther <address@hidden>

        * src/Field/PrintField.h: use forEach(,PerformUpdateTag(),) rather
        than applyRelations().

===== PrintField.h 1.3 vs edited =====
--- 1.3/r2/src/Field/PrintField.h       Wed Dec  3 12:30:41 2003
+++ edited/PrintField.h Wed Jan 14 12:01:09 2004
@@ -231,7 +231,7 @@
  template<class S, class A>
  void print(S &s, const A &a) const
    {
-      a.applyRelations();
+      forEach(a, PerformUpdateTag(), NullCombine());
      Pooma::blockAndEvaluate();

      for (int m = 0; m < a.numMaterials(); m++)

Great!  That's a good improvement.  Will you please commit the patch?

Jeffrey D. Oldham
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]