[PATCH] Finish/clean Div.UR.h

Jeffrey D. Oldham oldham at codesourcery.com
Thu Jul 15 22:57:15 UTC 2004


Richard Guenther wrote:

> Finishes (DivCellToVert) and cleans the Divergence operator 
> implementation.  Tested with only Div test.  As I was in the 
> neighbourhood.
>
> Ok?
>
> Richard.
>
>
> 2004Jul15  Richard Guenther <richard.guenther at uni-tuebingen.de>
>
>     * src/Field/DiffOps/Div.h: adjust documentation.
>     src/Field/DiffOps/Div.UR.h: implement DivCellToVert,
>     clean implementation.
>
> 
>   template<class F>
>   inline OutputElement_t
>   operator()(const F &f, int i1, int i2) const
>   {
>-    return 0.5 *
>-      (fact_m(0) *
>-       (f(i1 + 1, i2    )(0) - f(i1    , i2    )(0) +
>-	f(i1 + 1, i2 + 1)(0) - f(i1    , i2 + 1)(0)
>-	) +
>-       fact_m(1) *
>-       (f(i1    , i2 + 1)(1) - f(i1    , i2    )(1) +
>-	f(i1 + 1, i2 + 1)(1) - f(i1 + 1, i2    )(1)
>-	)
>-       );
>+    return OutputElement_t
>+      (fact_m(0) * (f.read(i1+1, i2)(0) - f.read(i1, i2)(0))
>+       + fact_m(1) * (f.read(i1, i2+1)(1) - f.read(i1, i2)(1)));
>   }
>  
>
Yes, this is a good patch.  For the operator()s, I suggest placing the + 
at the end of lines rather than at the beginning of the next line.  
Doing so will vertically align the addends, easing reading.

-- 
Jeffrey D. Oldham
oldham at codesourcery.com




More information about the pooma-dev mailing list