Field3D
MACField< Data_T > Class Template Reference

This subclass of Field implements a standard MAC field. Refer to your favorite fluid simulations book for an explanation. More...

#include <MACField.h>

Inheritance diagram for MACField< Data_T >:
ResizableField< Data_T > WritableField< Data_T > Field< Data_T > FieldRes FieldBase RefBase

List of all members.

Classes

class  const_mac_comp_iterator
class  mac_comp_iterator

Public Types

typedef MACField< Data_T > class_type
typedef CubicMACFieldInterp
< Data_T > 
CubicInterp
typedef LinearMACFieldInterp
< Data_T > 
LinearInterp
typedef boost::intrusive_ptr
< MACField
Ptr
typedef Data_T::BaseType real_t
 This typedef is used to refer to the scalar component type of the vectors.
typedef std::vector< PtrVec
 This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInputFile::readVectorLayers() will return its data in.

Public Member Functions

virtual void clear (const Data_T &value)
 Clears all the voxels in the storage.
void copyMAC (MACField::Ptr other)
 TEMP: Copies the MAC field data from another MAC field. This should be re-implemented using proper iterators over the field.
V3i getComponentSize () const
 Returns the size of U,V,W components.
real_t uCenter (int i, int j, int k) const
 Returns the u-component interpolated to the cell center.
real_t vCenter (int i, int j, int k) const
 Returns the v-component interpolated to the cell center.
real_t wCenter (int i, int j, int k) const
 Returns the w-component interpolated to the cell center.
Constructors & destructor
 MACField ()
 Constructs an empty buffer.
From Field
virtual Data_T value (int i, int j, int k) const
virtual long long int memSize () const
 Returns the memory usage (in bytes)
From WritableField
virtual Data_T & lvalue (int i, int j, int k)
 This will return the appropriate interpolated value but setting that to something else does not change the MAC field.
MAC-component access
const real_tu (int i, int j, int k) const
 Read access to value on u-facing wall.
real_tu (int i, int j, int k)
 Write access to value on u-facing wall.
const real_tv (int i, int j, int k) const
 Read access to value on v-facing wall.
real_tv (int i, int j, int k)
 Write access to value on v-facing wall.
const real_tw (int i, int j, int k) const
 Read access to value on w-facing wall.
real_tw (int i, int j, int k)
 Write access to value on w-facing wall.
MAC-component iterators

A note about MAC iterators The subset that we choose to iterate over is defined by voxels, not MAC face coordinates. Thus, iterator from (0, 0, 0) to (0, 0, 0) will actually visit (0, 0, 0) and (1, 0, 0) for the u component, and (0, 0, 0) to (0, 1, 0) for the v component...

const_mac_comp_iterator cbegin_comp (MACComponent comp) const
 Const iterator to first element. "cbegin" matches the tr1 c++ standard.
const_mac_comp_iterator cbegin_comp (MACComponent comp, const Box3i &subset) const
 Const iterator to first element of specific subset.
const_mac_comp_iterator cend_comp (MACComponent comp) const
 Const iterator to first element. "cbegin" matches the tr1 c++ standard.
const_mac_comp_iterator cend_comp (MACComponent comp, const Box3i &subset) const
 Const iterator to first element of specific subset.
mac_comp_iterator begin_comp (MACComponent comp)
 Iterator to first element.
mac_comp_iterator begin_comp (MACComponent comp, const Box3i &subset)
 Iterator to first element of specific subset.
mac_comp_iterator end_comp (MACComponent comp)
 Iterator to first element.
mac_comp_iterator end_comp (MACComponent comp, const Box3i &subset)
 Iterator to first element of specific subset.
From FieldBase
virtual std::string className () const
 Returns the class name of the object. Used by the class pool and when writing the data to disk.
virtual FieldBase::Ptr clone () const
 Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.

Static Public Member Functions

static const char * classType ()
static const char * staticClassName ()

Public Attributes

 DEFINE_FIELD_RTTI_CONCRETE_CLASS

Protected Member Functions

virtual void sizeChanged ()
 Subclasses should re-implement this if they need to perform memory allocations, etc. every time the size of the storage changes.
const real_tuPtr (int i, int j, int k) const
 Direct access to value on u-facing wall.
real_tuPtr (int i, int j, int k)
 Direct access to value on u-facing wall.
real_tvPtr (int i, int j, int k)
 Direct access to value on v-facing wall.
const real_tvPtr (int i, int j, int k) const
 Direct access to value on v-facing wall.
const real_twPtr (int i, int j, int k) const
 Direct access to value on w-facing wall.
real_twPtr (int i, int j, int k)
 Direct access to value on w-facing wall.

Protected Attributes

Data_T m_dummy
 Dummy storage of a temp value that lvalue() can write to.
std::vector< real_tm_u
 U component storage.
V3i m_uSize
 Size of U grid along each axis.
int m_uSizeXY
 Size of xy slice for u component.
std::vector< real_tm_v
 V component storage.
V3i m_vSize
 Size of V grid along each axis.
int m_vSizeXY
 Size of xy slice for v component.
std::vector< real_tm_w
 W component storage.
V3i m_wSize
 Size of W grid along each axis.
int m_wSizeXY
 Size of xy slice for w component.

Private Types

typedef ResizableField< Data_T > base
 Convenience typedef for referring to base class.

Static Private Attributes

static TemplatedFieldType
< MACField< Data_T > > 
ms_classType

Detailed Description

template<class Data_T>
class MACField< Data_T >

This subclass of Field implements a standard MAC field. Refer to your favorite fluid simulations book for an explanation.

The definition for u,v,w indexing used can be found on page 25 in Bridson - Fluid Simulation for Computer Graphics

Note:
This class can only be templated on Vec3 instances.

Definition at line 95 of file MACField.h.


Member Typedef Documentation

template<class Data_T>
typedef boost::intrusive_ptr<MACField> MACField< Data_T >::Ptr

Reimplemented from ResizableField< Data_T >.

Definition at line 101 of file MACField.h.

template<class Data_T>
typedef std::vector<Ptr> MACField< Data_T >::Vec

This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInputFile::readVectorLayers() will return its data in.

Reimplemented from Field< Data_T >.

Definition at line 102 of file MACField.h.

template<class Data_T>
typedef Data_T::BaseType MACField< Data_T >::real_t

This typedef is used to refer to the scalar component type of the vectors.

Definition at line 105 of file MACField.h.

template<class Data_T>
typedef LinearMACFieldInterp<Data_T> MACField< Data_T >::LinearInterp

Definition at line 107 of file MACField.h.

template<class Data_T>
typedef CubicMACFieldInterp<Data_T> MACField< Data_T >::CubicInterp

Definition at line 108 of file MACField.h.

template<class Data_T>
typedef MACField<Data_T> MACField< Data_T >::class_type

Reimplemented from ResizableField< Data_T >.

Definition at line 112 of file MACField.h.

template<class Data_T>
typedef ResizableField<Data_T> MACField< Data_T >::base [private]

Convenience typedef for referring to base class.

Reimplemented from ResizableField< Data_T >.

Definition at line 337 of file MACField.h.


Constructor & Destructor Documentation

template<class Data_T >
MACField< Data_T >::MACField ( )

Constructs an empty buffer.

Definition at line 600 of file MACField.h.

Referenced by MACField< Data_T >::clone().

  : base()
{
  
}

Member Function Documentation

template<class Data_T>
static const char* MACField< Data_T >::staticClassName ( ) [inline, static]

Reimplemented from ResizableField< Data_T >.

Definition at line 115 of file MACField.h.

Referenced by MACField< Data_T >::className().

  {
    return "MACField";
  }
template<class Data_T>
static const char* MACField< Data_T >::classType ( ) [inline, static]

Reimplemented from ResizableField< Data_T >.

Definition at line 120 of file MACField.h.

References FieldBase::name.

template<class Data_T>
void MACField< Data_T >::clear ( const Data_T &  value) [inline, virtual]

Clears all the voxels in the storage.

Reimplemented from WritableField< Data_T >.

Definition at line 609 of file MACField.h.

{
  std::fill(m_u.begin(), m_u.end(), value.x);
  std::fill(m_v.begin(), m_v.end(), value.y);
  std::fill(m_w.begin(), m_w.end(), value.z);
}
template<class Data_T >
Data_T MACField< Data_T >::value ( int  i,
int  j,
int  k 
) const [virtual]
Note:
This returns the voxel-centered interpolated value

Implements Field< Data_T >.

Definition at line 619 of file MACField.h.

Referenced by convertMACToCellCentered().

{
  return Data_T(uCenter(i, j, k), vCenter(i, j, k), wCenter(i, j, k));
}
template<class Data_T >
long long int MACField< Data_T >::memSize ( ) const [virtual]

Returns the memory usage (in bytes)

Note:
This needs to be re-implemented for any subclass that adds data members. Those classes should also call their superclass and add the combined memory use.

Reimplemented from FieldRes.

Definition at line 627 of file MACField.h.

{ 
  long long int superClassMemSize = base::memSize();
  long long int vectorMemSize = 
    (m_u.capacity() + m_v.capacity() + m_w.capacity()) * sizeof(real_t);
  return sizeof(*this) + vectorMemSize + superClassMemSize; 
}
template<class Data_T >
Data_T & MACField< Data_T >::lvalue ( int  i,
int  j,
int  k 
) [virtual]

This will return the appropriate interpolated value but setting that to something else does not change the MAC field.

Warning:
See description

Implements WritableField< Data_T >.

Definition at line 638 of file MACField.h.

{
  m_dummy = value(i, j, k);
  return m_dummy;
}
template<class Data_T >
const MACField< Data_T >::real_t & MACField< Data_T >::u ( int  i,
int  j,
int  k 
) const [inline]

Read access to value on u-facing wall.

Note:
i coordinate represents i-1/2!

Definition at line 687 of file MACField.h.

Referenced by convertCellCenteredToMAC(), CubicMACFieldInterp< Data_T >::sample(), LinearMACFieldInterp< Data_T >::sample(), and MACField< Data_T >::uCenter().

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x + 1);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_u[i + j * m_uSize.x + k * m_uSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t & MACField< Data_T >::u ( int  i,
int  j,
int  k 
) [inline]

Write access to value on u-facing wall.

Note:
i coordinate represents i-1/2!

Definition at line 706 of file MACField.h.

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x + 1);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_u[i + j * m_uSize.x + k * m_uSizeXY];
}
template<class Data_T >
const MACField< Data_T >::real_t & MACField< Data_T >::v ( int  i,
int  j,
int  k 
) const [inline]

Read access to value on v-facing wall.

Note:
j coordinate represents j-1/2!

Definition at line 725 of file MACField.h.

Referenced by convertCellCenteredToMAC(), CubicMACFieldInterp< Data_T >::sample(), LinearMACFieldInterp< Data_T >::sample(), and MACField< Data_T >::vCenter().

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y + 1);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_v[i + j * m_vSize.x + k * m_vSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t & MACField< Data_T >::v ( int  i,
int  j,
int  k 
) [inline]

Write access to value on v-facing wall.

Note:
j coordinate represents j-1/2!

Definition at line 744 of file MACField.h.

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y + 1);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_v[i + j * m_vSize.x + k * m_vSizeXY];
}
template<class Data_T >
const MACField< Data_T >::real_t & MACField< Data_T >::w ( int  i,
int  j,
int  k 
) const [inline]

Read access to value on w-facing wall.

Note:
k coordinate represents k-1/2!

Definition at line 763 of file MACField.h.

Referenced by convertCellCenteredToMAC(), CubicMACFieldInterp< Data_T >::sample(), LinearMACFieldInterp< Data_T >::sample(), and MACField< Data_T >::wCenter().

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z + 1);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_w[i + j * m_wSize.x + k * m_wSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t & MACField< Data_T >::w ( int  i,
int  j,
int  k 
) [inline]

Write access to value on w-facing wall.

Note:
k coordinate represents k-1/2!

Definition at line 782 of file MACField.h.

{
  assert (i >= base::m_dataWindow.min.x);
  assert (i <= base::m_dataWindow.max.x);
  assert (j >= base::m_dataWindow.min.y);
  assert (j <= base::m_dataWindow.max.y);
  assert (k >= base::m_dataWindow.min.z);
  assert (k <= base::m_dataWindow.max.z + 1);
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return m_w[i + j * m_wSize.x + k * m_wSizeXY];
}
template<class Data_T >
MACField< Data_T >::const_mac_comp_iterator MACField< Data_T >::cbegin_comp ( MACComponent  comp) const

Const iterator to first element. "cbegin" matches the tr1 c++ standard.

Definition at line 801 of file MACField.h.

References FieldRes::dataResolution(), and MACFieldUtil::makeDataWindowForComponent().

Referenced by MACFieldIO::writeData().

{
  using namespace MACFieldUtil;
  if (FieldRes::dataResolution() == V3i(0))
    return cend_comp(comp);
  Box3i dataWindow = 
    makeDataWindowForComponent(base::m_dataWindow, comp);
  return const_mac_comp_iterator(comp, *this, dataWindow, dataWindow.min);
}
template<class Data_T >
MACField< Data_T >::const_mac_comp_iterator MACField< Data_T >::cbegin_comp ( MACComponent  comp,
const Box3i subset 
) const

Const iterator to first element of specific subset.

Definition at line 815 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  if (subset.isEmpty())
    return cend_comp(comp, subset);
  Box3i dataWindow = makeDataWindowForComponent(subset, comp);
  return const_mac_comp_iterator(comp, *this, dataWindow, subset.min);
}
template<class Data_T >
MACField< Data_T >::const_mac_comp_iterator MACField< Data_T >::cend_comp ( MACComponent  comp) const

Const iterator to first element. "cbegin" matches the tr1 c++ standard.

Definition at line 828 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  Box3i dataWindow = 
    makeDataWindowForComponent(base::m_dataWindow, comp);
  return const_mac_comp_iterator(comp, *this, dataWindow, 
                                 V3i(dataWindow.min.x,
                                     dataWindow.min.y,
                                     dataWindow.max.z + 1));
}
template<class Data_T >
MACField< Data_T >::const_mac_comp_iterator MACField< Data_T >::cend_comp ( MACComponent  comp,
const Box3i subset 
) const

Const iterator to first element of specific subset.

Definition at line 843 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  Box3i dataWindow = makeDataWindowForComponent(subset, comp);
  return const_mac_comp_iterator(comp, *this, dataWindow, 
                                 V3i(dataWindow.min.x,
                                     dataWindow.min.y,
                                     dataWindow.max.z + 1));
}
template<class Data_T >
MACField< Data_T >::mac_comp_iterator MACField< Data_T >::begin_comp ( MACComponent  comp)

Iterator to first element.

Definition at line 857 of file MACField.h.

References FieldRes::dataResolution(), and MACFieldUtil::makeDataWindowForComponent().

Referenced by MACFieldIO::readData().

{
  using namespace MACFieldUtil;
  if (FieldRes::dataResolution() == V3i(0))
    return end_comp(comp);
  Box3i dataWindow = makeDataWindowForComponent(base::m_dataWindow, comp);
  return mac_comp_iterator(comp, *this, dataWindow, dataWindow.min);
}
template<class Data_T >
MACField< Data_T >::mac_comp_iterator MACField< Data_T >::begin_comp ( MACComponent  comp,
const Box3i subset 
)

Iterator to first element of specific subset.

Definition at line 870 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  if (subset.isEmpty())
    return end_comp(comp, subset);
  Box3i dataWindow = makeDataWindowForComponent(subset, comp);
  return mac_comp_iterator(comp, *this, dataWindow, subset.min);
}
template<class Data_T >
MACField< Data_T >::mac_comp_iterator MACField< Data_T >::end_comp ( MACComponent  comp)

Iterator to first element.

Definition at line 883 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  Box3i dataWindow = makeDataWindowForComponent(base::m_dataWindow, comp);
  return mac_comp_iterator(comp, *this, dataWindow, V3i(dataWindow.min.x,
                                                        dataWindow.min.y,
                                                        dataWindow.max.z + 1));
}
template<class Data_T >
MACField< Data_T >::mac_comp_iterator MACField< Data_T >::end_comp ( MACComponent  comp,
const Box3i subset 
)

Iterator to first element of specific subset.

Definition at line 896 of file MACField.h.

References MACFieldUtil::makeDataWindowForComponent().

{
  using namespace MACFieldUtil;
  Box3i dataWindow = makeDataWindowForComponent(subset, comp);
  return mac_comp_iterator(comp, *this, dataWindow, V3i(dataWindow.min.x,
                                                        dataWindow.min.y,
                                                        dataWindow.max.z + 1));
}
template<class Data_T>
real_t MACField< Data_T >::uCenter ( int  i,
int  j,
int  k 
) const [inline]

Returns the u-component interpolated to the cell center.

Definition at line 233 of file MACField.h.

References MACField< Data_T >::u().

  {
    return (u(i, j, k) + u(i + 1, j, k)) * 0.5;
  }
template<class Data_T>
real_t MACField< Data_T >::vCenter ( int  i,
int  j,
int  k 
) const [inline]

Returns the v-component interpolated to the cell center.

Definition at line 238 of file MACField.h.

References MACField< Data_T >::v().

  {
    return (v(i, j, k) + v(i, j + 1, k)) * 0.5;
  }
template<class Data_T>
real_t MACField< Data_T >::wCenter ( int  i,
int  j,
int  k 
) const [inline]

Returns the w-component interpolated to the cell center.

Definition at line 243 of file MACField.h.

References MACField< Data_T >::w().

  {
    return (w(i, j, k) + w(i, j, k + 1)) * 0.5;
  }
template<class Data_T>
void MACField< Data_T >::copyMAC ( MACField< Data_T >::Ptr  other) [inline]

TEMP: Copies the MAC field data from another MAC field. This should be re-implemented using proper iterators over the field.

Definition at line 250 of file MACField.h.

References MACField< Data_T >::m_u, MACField< Data_T >::m_v, MACField< Data_T >::m_w, and ResizableField< Data_T >::matchDefinition().

  {
    matchDefinition(other);
    std::copy(other->m_u.begin(), other->m_u.end(), m_u.begin());
    std::copy(other->m_v.begin(), other->m_v.end(), m_v.begin());
    std::copy(other->m_w.begin(), other->m_w.end(), m_w.begin());
  }
template<class Data_T>
V3i MACField< Data_T >::getComponentSize ( ) const [inline]

Returns the size of U,V,W components.

Definition at line 261 of file MACField.h.

References MACField< Data_T >::m_u, MACField< Data_T >::m_v, and MACField< Data_T >::m_w.

Referenced by MACFieldIO::writeData(), and MACFieldIO::writeInternal().

  { return V3i(m_u.size(), m_v.size(), m_w.size()); }
template<class Data_T>
virtual std::string MACField< Data_T >::className ( ) const [inline, virtual]

Returns the class name of the object. Used by the class pool and when writing the data to disk.

Note:
This is different from classType for any templated class, as classType() will include the template parameter(s) but className remains just the name of the template itself.

Implements FieldBase.

Definition at line 269 of file MACField.h.

References MACField< Data_T >::staticClassName().

  { return staticClassName(); }
template<class Data_T>
virtual FieldBase::Ptr MACField< Data_T >::clone ( ) const [inline, virtual]

Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.

Implements FieldBase.

Definition at line 272 of file MACField.h.

References MACField< Data_T >::MACField().

  { return Ptr(new MACField(*this)); }
template<class Data_T >
void MACField< Data_T >::sizeChanged ( ) [protected, virtual]

Subclasses should re-implement this if they need to perform memory allocations, etc. every time the size of the storage changes.

Note:
Make sure to call the base class version in subclasses!

Reimplemented from ResizableField< Data_T >.

Definition at line 647 of file MACField.h.

{
  // Call base class
  base::sizeChanged();

  V3i baseSize = 
    base::m_dataWindow.max - base::m_dataWindow.min + V3i(1);

  if (std::min(std::min(baseSize.x, baseSize.y), baseSize.z) < 0)
    throw Exc::ResizeException("Attempt to resize ResizableField object "
                               "using negative size. Data window was: " +
                               boost::lexical_cast<std::string>(baseSize));

  // Calculate the size for each component of the MAC field
  m_uSize = baseSize + V3i(1, 0, 0);
  m_vSize = baseSize + V3i(0, 1, 0);
  m_wSize = baseSize + V3i(0, 0, 1);

  // Calculate the size of each z slice
  m_uSizeXY = m_uSize.x * m_uSize.y;
  m_vSizeXY = m_vSize.x * m_vSize.y;
  m_wSizeXY = m_wSize.x * m_wSize.y;

  // Allocate memory
  try {
    m_u.resize(m_uSize.x * m_uSize.y * m_uSize.z);
    m_v.resize(m_vSize.x * m_vSize.y * m_vSize.z);
    m_w.resize(m_wSize.x * m_wSize.y * m_wSize.z);
  }
  catch (std::bad_alloc &e) {
    throw Exc::MemoryException("Couldn't allocate MACField of size " + 
                               boost::lexical_cast<std::string>(baseSize));
  }

}
template<class Data_T >
const MACField< Data_T >::real_t * MACField< Data_T >::uPtr ( int  i,
int  j,
int  k 
) const [inline, protected]

Direct access to value on u-facing wall.

Note:
i coordinate represents i-1/2!

Definition at line 909 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_u[i + j * m_uSize.x + k * m_uSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t * MACField< Data_T >::uPtr ( int  i,
int  j,
int  k 
) [inline, protected]

Direct access to value on u-facing wall.

Note:
i coordinate represents i-1/2!

Definition at line 922 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_u[i + j * m_uSize.x + k * m_uSizeXY];
}
template<class Data_T >
const MACField< Data_T >::real_t * MACField< Data_T >::vPtr ( int  i,
int  j,
int  k 
) const [inline, protected]

Direct access to value on v-facing wall.

Note:
j coordinate represents j-1/2!

Definition at line 935 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_v[i + j * m_vSize.x + k * m_vSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t * MACField< Data_T >::vPtr ( int  i,
int  j,
int  k 
) [inline, protected]

Direct access to value on v-facing wall.

Note:
j coordinate represents j-1/2!

Definition at line 948 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_v[i + j * m_vSize.x + k * m_vSizeXY];
}
template<class Data_T >
const MACField< Data_T >::real_t * MACField< Data_T >::wPtr ( int  i,
int  j,
int  k 
) const [inline, protected]

Direct access to value on w-facing wall.

Note:
k coordinate represents k-1/2!

Definition at line 961 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_w[i + j * m_wSize.x + k * m_wSizeXY];
}
template<class Data_T >
MACField< Data_T >::real_t * MACField< Data_T >::wPtr ( int  i,
int  j,
int  k 
) [inline, protected]

Direct access to value on w-facing wall.

Note:
k coordinate represents k-1/2!

Definition at line 974 of file MACField.h.

{
  // Add crop window offset
  i -= base::m_dataWindow.min.x;
  j -= base::m_dataWindow.min.y;
  k -= base::m_dataWindow.min.z;
  return &m_w[i + j * m_wSize.x + k * m_wSizeXY];
}

Member Data Documentation

template<class Data_T>
MACField< Data_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 113 of file MACField.h.

template<class Data_T>
std::vector<real_t> MACField< Data_T >::m_u [protected]

U component storage.

Definition at line 307 of file MACField.h.

Referenced by MACField< Data_T >::copyMAC(), and MACField< Data_T >::getComponentSize().

template<class Data_T>
std::vector<real_t> MACField< Data_T >::m_v [protected]

V component storage.

Definition at line 309 of file MACField.h.

Referenced by MACField< Data_T >::copyMAC(), and MACField< Data_T >::getComponentSize().

template<class Data_T>
std::vector<real_t> MACField< Data_T >::m_w [protected]

W component storage.

Definition at line 311 of file MACField.h.

Referenced by MACField< Data_T >::copyMAC(), and MACField< Data_T >::getComponentSize().

template<class Data_T>
V3i MACField< Data_T >::m_uSize [protected]

Size of U grid along each axis.

Definition at line 314 of file MACField.h.

template<class Data_T>
int MACField< Data_T >::m_uSizeXY [protected]

Size of xy slice for u component.

Definition at line 316 of file MACField.h.

template<class Data_T>
V3i MACField< Data_T >::m_vSize [protected]

Size of V grid along each axis.

Definition at line 318 of file MACField.h.

template<class Data_T>
int MACField< Data_T >::m_vSizeXY [protected]

Size of xy slice for v component.

Definition at line 320 of file MACField.h.

template<class Data_T>
V3i MACField< Data_T >::m_wSize [protected]

Size of W grid along each axis.

Definition at line 322 of file MACField.h.

template<class Data_T>
int MACField< Data_T >::m_wSizeXY [protected]

Size of xy slice for w component.

Definition at line 324 of file MACField.h.

template<class Data_T>
Data_T MACField< Data_T >::m_dummy [mutable, protected]

Dummy storage of a temp value that lvalue() can write to.

Definition at line 327 of file MACField.h.

template<class Data_T>
TemplatedFieldType<MACField<Data_T> > MACField< Data_T >::ms_classType [static, private]

Reimplemented from ResizableField< Data_T >.

Definition at line 333 of file MACField.h.


The documentation for this class was generated from the following file: