From c482887c99c811201957f926c8395b789ab037a2 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 6 Jun 2017 18:25:41 +0100 Subject: [PATCH] Add null constructors to crAddressing and crMatrix --- src/foam/matrices/crMatrix/crAddressing.C | 13 +++++++++++++ src/foam/matrices/crMatrix/crAddressing.H | 4 ++++ src/foam/matrices/crMatrix/crMatrix.C | 9 +++++++++ src/foam/matrices/crMatrix/crMatrix.H | 3 +++ 4 files changed, 29 insertions(+) diff --git a/src/foam/matrices/crMatrix/crAddressing.C b/src/foam/matrices/crMatrix/crAddressing.C index f7e2a81d8..ed695724f 100644 --- a/src/foam/matrices/crMatrix/crAddressing.C +++ b/src/foam/matrices/crMatrix/crAddressing.C @@ -65,6 +65,19 @@ void Foam::crAddressing::setRowSizes(const labelList& rowSizes) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// Construct null +Foam::crAddressing::crAddressing() +: + refCount(), + nRows_(0), + nCols_(0), + rowStart_(1), + column_(0) +{ + rowStart_[0] = 1; +} + + // Construct from given size Foam::crAddressing::crAddressing ( diff --git a/src/foam/matrices/crMatrix/crAddressing.H b/src/foam/matrices/crMatrix/crAddressing.H index 517e3d57d..1edfbf7e9 100644 --- a/src/foam/matrices/crMatrix/crAddressing.H +++ b/src/foam/matrices/crMatrix/crAddressing.H @@ -69,6 +69,7 @@ class crAddressing //- Column index array labelList column_; + // Private Member Functions //- Set row sizes @@ -79,6 +80,9 @@ public: // Constructors + //- Construct null + crAddressing(); + //- Construct given size. Column and coefficients set later crAddressing ( diff --git a/src/foam/matrices/crMatrix/crMatrix.C b/src/foam/matrices/crMatrix/crMatrix.C index 942583999..c00efcf07 100644 --- a/src/foam/matrices/crMatrix/crMatrix.C +++ b/src/foam/matrices/crMatrix/crMatrix.C @@ -36,6 +36,15 @@ Author // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// Construct null +Foam::crMatrix::crMatrix() +: + refCount(), + crAddr_(), + coeffs_() +{} + + // Construct from addressing Foam::crMatrix::crMatrix(const crAddressing& addr) : diff --git a/src/foam/matrices/crMatrix/crMatrix.H b/src/foam/matrices/crMatrix/crMatrix.H index 449bb5233..d4a4e45fd 100644 --- a/src/foam/matrices/crMatrix/crMatrix.H +++ b/src/foam/matrices/crMatrix/crMatrix.H @@ -67,6 +67,9 @@ public: // Constructors + //- Construct null + crMatrix(); + //- Construct from addressing crMatrix(const crAddressing& addr);