freepooma-devel
[Top][All Lists]
Advanced

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

RE: [pooma-dev] src/Particles/tests compilable


From: Julian C. Cummings
Subject: RE: [pooma-dev] src/Particles/tests compilable
Date: Sat, 17 Jul 2004 11:22:45 -0700

Richard,

The guard layers act differently than usual in a particle scatter operation
because it is possible for particles to scatter a portion of their data
value into guard cells.  At the end of the scatter operation, we must add
the value in a physical cell to the values in all of the corresponding guard
cells and assign that to the physical cell.  And then we can update the
guard cells from the physical cells once again for consistency.  So the
zeroing of the guard cells is needed at the beginning so that there is no
miscounting.  It is the equivalent of setting a summation variable to zero
before beginning to compute the sum.  The external guard cells are a bit
different because they presumably do not have any corresponding physical
cells.  There is probably no chance of miscounting the scatter in this case.
However, there could be a boundary condition that has set the external guard
cells to a non-zero value, so we zero them out as well. 

These actions are primarily safety measures to guard against user stupidity.
Perhaps there is an easier way now to achieve the same effect by doing
field.all() = 0.0.  This may have been a syntax that was added after the
particle-field interpolation code was written.  It makes more sense to just
make sure the *entire* field is zero before starting the scatter
computation.  Alternatively, you could leave this responsibility to the user
and write some assertion code that just checks that all physical and guard
cells are set to zero.  The assertion code would be removed in an optimized
compile.

Regards, Julian C.

Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
address@hidden
 

> -----Original Message-----
> From: Richard Guenther [mailto:address@hidden 
> Sent: Thursday, July 15, 2004 1:28 PM
> To: Roman Krylov
> Cc: address@hidden
> Subject: Re: [pooma-dev] src/Particles/tests compilable
> 
> 
> Roman Krylov wrote:
> > Hi.
> > Now all src/Particles/tests compilable.
> > 
> > What I have to note especially is that I had commented //#include 
> > "Particles/InterpolatorNGP.h" //#include 
> "Particles/InterpolatorCIC.h"
> > //#include "Particles/InterpolatorSUDS.h"
> > in src/Pooma/Particles.h - I think it'll be better if one 
> who need it 
> > will include it manually OK?
> > And I've commented all 'setExternalGuards(field,zero);'. As 
> I thought 
> > external guards are only an optimization not real g.l. ?
> 
> They are real guard layers, but this use looked suspicious to 
> me, too, 
> as usually external guards filling is up to the user, as is 
> the physical 
> domain.  Maybe Julian can comment on this:
> 
> Interpolator<Dim,T,CIC>::scatter(const PA& attrib, const FC& field, 
> const PPos& pos)
> {
>     ...
>        // Zero out the guard layers before scattering
>        typename FC::Element_t zero(0);
>        field.engine().setGuards(zero);
>        setExternalGuards(field,zero);
>     ...
> }
> 
> The question is, if we assume the destination field to be 
> zeroed by the 
> user at entry of this function, then we need to do this only if we 
> bypass the guard updating.  And this will be an optimization, if and 
> only if we assum initial zero field value (else clearing the internal 
> guards is even wrong).  The external guards can be handled by 
> the user by just field.all() = 0.0; before scattering, 
> instead of field = 0.0;
> 
> How was this all supposed to being used?
> 
> Richard.
> 
> > As I had noticed previously 'pointIndex'->'cellContaining' and also 
> > 'indexPoint'->'vertexPosition'. Well here they are(attached).
> > Roman.
> 

reply via email to

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