[PATCH] Add viewing constructor to FieldCentering
Richard Guenther
rguenth at tat.physik.uni-tuebingen.de
Sat Nov 8 17:57:30 UTC 2003
Hi!
This patch adds a viewing constructor to FieldCentering and cleans up
some accessors. It mainly allows using this from initializers in
FieldEngine sub-field views (patch to come).
Ok?
Richard.
2003Nov08 Richard Guenther <richard.guenther at uni-tuebingen.de>
* src/Field/FieldCentering.h: add Centering(model, c) constructor.
Clean up accessors.
===== FieldCentering.h 1.7 vs edited =====
--- 1.7/r2/src/Field/FieldCentering.h Sat Nov 8 18:53:47 2003
+++ edited/FieldCentering.h Sat Nov 8 18:54:17 2003
@@ -236,13 +236,22 @@
return;
}
+ /// Sub-centering constructor.
+
+ Centering(const Centering<Dim>& model, int c)
+ : centering_type_m(model.centering_type_m),
+ discontinuous_m(model.discontinuous_m),
+ orientations_m(1, model.orientations_m[c]),
+ positions_m(1, model.positions_m[c])
+ { }
+
//@}
//---------------------------------------------------------------------------
/// Sub-centering creation function. This is not really meant to be
/// called by users.
/// Return a centering with one specified value.
- const Centering<Dim> operator[](int iSubField) const
+ Centering<Dim> operator[](int iSubField) const
{
#if POOMA_BOUNDS_CHECK
PInsist(iSubField >= 0 && iSubField < size(),
@@ -263,12 +272,12 @@
//@name Accessors.
//@{
- inline const CenteringType ¢eringType() const
+ inline CenteringType centeringType() const
{
return centering_type_m;
}
- inline const ContinuityType &continuityType() const
+ inline ContinuityType continuityType() const
{
return discontinuous_m;
}
More information about the pooma-dev
mailing list