shrink() and FieldEngine.NoGeometry.h Compilation

Jeffrey Oldham oldham at codesourcery.com
Fri May 4 16:05:37 UTC 2001


Scott,

	Thanks for the quick patch approval.  I committed the patch
excepting the changes to src/NewField/FieldEngine.NoGeometry.h.

	I do not understand how FieldEngine.NoGeometry.h's
FieldEngine<NoGeometry<Dim>, T, EngineTag> compiles.

  inline const Domain_t physicalCellDomain() const
    {
      return shrink(physicalDomain(), 1);
    }

The only shrink() definition I could find is in
src/Layout/GuardLayers.h:

  template<int Dim>
  inline Interval<Dim> 
  shrink(const Interval<Dim> &dom, const GuardLayers<Dim> &gcs)
  {
    Interval<Dim> ret(dom);
    return shrinkInPlace(ret, gcs);
  }

One can convert shrink()'s second argument `1' to a GuardLayers<Dim>,
but this cannot happen implicitly because the associated GuardLayers
constructor is marked explicit:

  template <int Dim>
  class GuardLayers
  {
  public:

    explicit GuardLayers(int gcs = 0);

Do you agree this is a problem?  Is the attached patch acceptable?  (I
am experiencing compilation problems so I have not tested the patch.)

2001-05-04  Jeffrey D. Oldham  <oldham at codesourcery.com>

	* FieldEngine.NoGeometry.h (FieldEngine::physicalCellDomain):
	Modify return type by removing reference.  Change second function
	call argument to match function prototype.
	(FieldEngine::totalCellDomain): Change second function call
	argument to match function prototype.

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: FieldEngine.NoGeometry.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/FieldEngine/FieldEngine.NoGeometry.h,v
retrieving revision 1.4
diff -c -p -r1.4 FieldEngine.NoGeometry.h
*** FieldEngine.NoGeometry.h	2001/04/10 23:13:25	1.4
--- FieldEngine.NoGeometry.h	2001/05/04 16:03:48
*************** public:
*** 254,267 ****
    // This field-engine always has vert-centering and the total domain is
    // given by the engine.
          
!   inline const Domain_t &physicalCellDomain() const
      {
!       return shrink(physicalDomain(), 1);
      }
          
    inline Domain_t totalCellDomain() const
      {
!       return shrink(engine_m.domain(), 1);
      }
  
    Domain_t physicalDomain() const
--- 254,267 ----
    // This field-engine always has vert-centering and the total domain is
    // given by the engine.
          
!   inline const Domain_t physicalCellDomain() const
      {
!       return shrink(physicalDomain(), GuardLayers(1));
      }
          
    inline Domain_t totalCellDomain() const
      {
!       return shrink(engine_m.domain(), GuardLayers(1));
      }
  
    Domain_t physicalDomain() const


More information about the pooma-dev mailing list