Commit 86c3affb authored by henry's avatar henry
Browse files

Added initialising constructor and use it is the BSpline code.

parent 135f8275
...@@ -32,7 +32,20 @@ template<class Type> ...@@ -32,7 +32,20 @@ template<class Type>
Foam::simpleMatrix<Type>::simpleMatrix(const label mSize) Foam::simpleMatrix<Type>::simpleMatrix(const label mSize)
: :
scalarSquareMatrix(mSize), scalarSquareMatrix(mSize),
source_(mSize, pTraits<Type>::zero) source_(mSize)
{}
template<class Type>
Foam::simpleMatrix<Type>::simpleMatrix
(
const label mSize,
const scalar coeffVal,
const Type& sourceVal
)
:
scalarSquareMatrix(mSize, mSize, coeffVal),
source_(mSize, sourceVal)
{} {}
......
...@@ -26,7 +26,7 @@ Class ...@@ -26,7 +26,7 @@ Class
Foam::simpleMatrix Foam::simpleMatrix
Description Description
Foam::simpleMatrix A simple square matrix solver with scalar coefficients.
SourceFiles SourceFiles
simpleMatrix.C simpleMatrix.C
...@@ -75,8 +75,13 @@ public: ...@@ -75,8 +75,13 @@ public:
// Constructors // Constructors
//- Construct given size //- Construct given size
// Note: this does not initialise the coefficients or the source.
simpleMatrix(const label); simpleMatrix(const label);
//- Construct given size and initial values for the
// coefficients and source
simpleMatrix(const label, const scalar, const Type&);
//- Construct from components //- Construct from components
simpleMatrix(const scalarSquareMatrix&, const Field<Type>&); simpleMatrix(const scalarSquareMatrix&, const Field<Type>&);
...@@ -91,11 +96,13 @@ public: ...@@ -91,11 +96,13 @@ public:
// Access // Access
//- Return access to the source
Field<Type>& source() Field<Type>& source()
{ {
return source_; return source_;
} }
//- Return const-access to the source
const Field<Type>& source() const const Field<Type>& source() const
{ {
return source_; return source_;
......
...@@ -48,7 +48,7 @@ Foam::pointField Foam::BSpline::findKnots ...@@ -48,7 +48,7 @@ Foam::pointField Foam::BSpline::findKnots
register scalar oneSixth = 1.0/6.0; register scalar oneSixth = 1.0/6.0;
register scalar twoThird = 2.0/3.0; register scalar twoThird = 2.0/3.0;
simpleMatrix<vector> M(newnKnots); simpleMatrix<vector> M(newnKnots, 0, vector::zero);
// set up the matrix // set up the matrix
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment