RFA: Cylindrical Printing, Reordering, Typo
Jeffrey Oldham
oldham at codesourcery.com
Thu Mar 29 22:50:27 UTC 2001
These changes
1) permit printing a Cylindrical/Polar/RhoZ/Rho Mesh. I used the
Cartesian print functions as a model.
2) reorder some constructor's initializers.
3) s/too/to/ in a comment.
OK to commit?
(Would you prefer patches of this size or larger patches with more
items?
2001-03-29 Jeffrey D. Oldham <oldham at codesourcery.com>
* CoordinateSystems/Cylindrical.h (Cylindrical::print): New
function to permit printing a Cylindrical Mesh.
(operator<<): Likewise.
(Polar::print): New function to permit printing a Polar Mesh.
(operator<<): Likewise.
(RhoZ::print): New function to permit printing a RhoZ Mesh.
(operator<<): Likewise.
(Rho::print): New function to permit printing a Rho Mesh.
(operator<<): Likewise.
* Engine/ConstantFunctionEngine.h (Engine::Engine): Reorder
initializers per class member order.
* Meshes/UniformRectilinearMesh.cpp
(UniformRectilinearMeshData::UniformRectilinearMeshData):
Likewise.
* Pooma/Pooma.cmpl.cpp (initialize): Fix typo in comment.
Tested on sequential Linux using gcc 3.1
Reviewed by ???you???
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: CoordinateSystems/Cylindrical.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/CoordinateSystems/Cylindrical.h,v
retrieving revision 1.13
diff -c -p -r1.13 Cylindrical.h
*** CoordinateSystems/Cylindrical.h 2000/07/28 20:54:32 1.13
--- CoordinateSystems/Cylindrical.h 2001/03/29 22:36:25
*************** public:
*** 178,183 ****
--- 178,192 ----
(pt2(2) - pt1(2))*(pt2(2) - pt1(2)));
}
+ // --------------------------------------------------------------------------
+ // Print a Cylindrical<Dim> on an output stream.
+
+ template <class Ostream>
+ void print(Ostream &ostr) const
+ {
+ ostr << "Cylindrical";
+ }
+
private:
// since we can't depend on math.h being included, and/or
// if included, that it defines M_PI . . .
*************** private:
*** 186,191 ****
--- 195,213 ----
};
//-----------------------------------------------------------------------------
+ //
+ // ostream inserter for Cylindrical<Dim>.
+ //
+ //-----------------------------------------------------------------------------
+
+ std::ostream &operator<<(std::ostream &ostr,
+ const Cylindrical &cs)
+ {
+ cs.print(ostr);
+ return ostr;
+ }
+
+ //-----------------------------------------------------------------------------
// Full Description:
//
// Polar : A 2D cylindrical subset (rho,phi)
*************** public:
*** 277,288 ****
--- 299,331 ----
sin(pt1(1))*sin(pt2(1))));
}
+ // --------------------------------------------------------------------------
+ // Print a Polar on an output stream.
+
+ template <class Ostream>
+ void print(Ostream &ostr) const
+ {
+ ostr << "Polar";
+ }
+
private:
// since we can't depend on math.h being included, and/or
// having M_PI defined...
static const double pi_m = 3.1415926535897932384626433832795029;
};
+ //-----------------------------------------------------------------------------
+ //
+ // ostream inserter for Polar.
+ //
+ //-----------------------------------------------------------------------------
+
+ std::ostream &operator<<(std::ostream &ostr,
+ const Polar &cs)
+ {
+ cs.print(ostr);
+ return ostr;
+ }
//-----------------------------------------------------------------------------
// Full Description:
*************** public:
*** 371,379 ****
--- 414,443 ----
(pt2(1) - pt1(1))*(pt2(1) - pt1(1)));
}
+ // --------------------------------------------------------------------------
+ // Print a RhoZ on an output stream.
+
+ template <class Ostream>
+ void print(Ostream &ostr) const
+ {
+ ostr << "RhoZ";
+ }
+
private:
};
+ //-----------------------------------------------------------------------------
+ //
+ // ostream inserter for RhoZ.
+ //
+ //-----------------------------------------------------------------------------
+
+ std::ostream &operator<<(std::ostream &ostr,
+ const RhoZ &cs)
+ {
+ cs.print(ostr);
+ return ostr;
+ }
//-----------------------------------------------------------------------------
// Full Description:
*************** public:
*** 439,447 ****
--- 503,532 ----
return sqrt((pt2(0) - pt1(0))*(pt2(0) - pt1(0)));
}
+ // --------------------------------------------------------------------------
+ // Print a Rho on an output stream.
+
+ template <class Ostream>
+ void print(Ostream &ostr) const
+ {
+ ostr << "Rho";
+ }
+
private:
};
+ //-----------------------------------------------------------------------------
+ //
+ // ostream inserter for Rho.
+ //
+ //-----------------------------------------------------------------------------
+
+ std::ostream &operator<<(std::ostream &ostr,
+ const Rho &cs)
+ {
+ cs.print(ostr);
+ return ostr;
+ }
//} // namespace pooma_cylindrical_coordinates
Index: Engine/ConstantFunctionEngine.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Engine/ConstantFunctionEngine.h,v
retrieving revision 1.16
diff -c -p -r1.16 ConstantFunctionEngine.h
*** Engine/ConstantFunctionEngine.h 2000/07/20 15:39:26 1.16
--- Engine/ConstantFunctionEngine.h 2001/03/29 22:36:26
*************** public:
*** 100,106 ****
// Construct from a domain object.
Engine(const Domain_t &domain, T val = T())
! : domain_m(domain), val_m(val)
{
for (int d = 0; d < Dim; ++d)
firsts_m[d] = domain[d].first();
--- 100,106 ----
// Construct from a domain object.
Engine(const Domain_t &domain, T val = T())
! : val_m(val), domain_m(domain)
{
for (int d = 0; d < Dim; ++d)
firsts_m[d] = domain[d].first();
Index: Meshes/UniformRectilinearMesh.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Meshes/UniformRectilinearMesh.cpp,v
retrieving revision 1.14
diff -c -p -r1.14 UniformRectilinearMesh.cpp
*** Meshes/UniformRectilinearMesh.cpp 2000/03/07 13:17:41 1.14
--- Meshes/UniformRectilinearMesh.cpp 2001/03/29 22:36:26
*************** UniformRectilinearMeshData(const Domain_
*** 81,92 ****
totalDomain_m(guardLayers().addGuardLayersToDomain(physicalDomain())),
totalCellDomain_m(
guardLayers().addGuardLayersToDomain(physicalCellDomain())),
cellVolumes_m(totalCellDomain()),
- vertexDeltas_m(totalCellDomain()),
vertexPositions_m(totalDomain()),
! cellSurfaceNormals_m(totalCellDomain()),
! origin_m(origin),
! spacings_m(spacings)
{
initializeFunctionArrays();
}
--- 81,92 ----
totalDomain_m(guardLayers().addGuardLayersToDomain(physicalDomain())),
totalCellDomain_m(
guardLayers().addGuardLayersToDomain(physicalCellDomain())),
+ origin_m(origin),
+ spacings_m(spacings),
cellVolumes_m(totalCellDomain()),
vertexPositions_m(totalDomain()),
! vertexDeltas_m(totalCellDomain()),
! cellSurfaceNormals_m(totalCellDomain())
{
initializeFunctionArrays();
}
*************** UniformRectilinearMeshData(const This_t
*** 103,115 ****
guardLayers_m(model.guardLayers()),
totalDomain_m(model.totalDomain()),
totalCellDomain_m(model.totalCellDomain()),
- cellVolumes_m(model.cellVolumes()),
- vertexDeltas_m(model.vertexDeltas()),
- vertexPositions_m(model.vertexPositions()),
- cellSurfaceNormals_m(model.cellSurfaceNormals()),
origin_m(model.origin()),
spacings_m(model.spacings()),
! invspacings_m(model.invspacings())
{ }
//-----------------------------------------------------------------------------
--- 103,115 ----
guardLayers_m(model.guardLayers()),
totalDomain_m(model.totalDomain()),
totalCellDomain_m(model.totalCellDomain()),
origin_m(model.origin()),
spacings_m(model.spacings()),
! invspacings_m(model.invspacings()),
! cellVolumes_m(model.cellVolumes()),
! vertexPositions_m(model.vertexPositions()),
! vertexDeltas_m(model.vertexDeltas()),
! cellSurfaceNormals_m(model.cellSurfaceNormals())
{ }
//-----------------------------------------------------------------------------
Index: Pooma/Pooma.cmpl.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/Pooma.cmpl.cpp,v
retrieving revision 1.36
diff -c -p -r1.36 Pooma.cmpl.cpp
*** Pooma/Pooma.cmpl.cpp 2000/06/08 22:16:34 1.36
--- Pooma/Pooma.cmpl.cpp 2001/03/29 22:36:27
*************** bool initialize(Options &opts, bool init
*** 365,371 ****
#endif
! // Enable logging too a file, if requested.
logstream_s = 0;
logMessages(opts.logfile().c_str());
--- 365,371 ----
#endif
! // Enable logging to a file, if requested.
logstream_s = 0;
logMessages(opts.logfile().c_str());
More information about the pooma-dev
mailing list