Added initialising constructor and use it is the BSpline code.
This commit is contained in:
parent
135f8275ac
commit
86c3affb5b
@ -32,7 +32,20 @@ template<class Type>
|
||||
Foam::simpleMatrix<Type>::simpleMatrix(const label 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
|
||||
Foam::simpleMatrix
|
||||
|
||||
Description
|
||||
Foam::simpleMatrix
|
||||
A simple square matrix solver with scalar coefficients.
|
||||
|
||||
SourceFiles
|
||||
simpleMatrix.C
|
||||
@ -75,8 +75,13 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct given size
|
||||
// Note: this does not initialise the coefficients or the source.
|
||||
simpleMatrix(const label);
|
||||
|
||||
//- Construct given size and initial values for the
|
||||
// coefficients and source
|
||||
simpleMatrix(const label, const scalar, const Type&);
|
||||
|
||||
//- Construct from components
|
||||
simpleMatrix(const scalarSquareMatrix&, const Field<Type>&);
|
||||
|
||||
@ -91,11 +96,13 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return access to the source
|
||||
Field<Type>& source()
|
||||
{
|
||||
return source_;
|
||||
}
|
||||
|
||||
//- Return const-access to the source
|
||||
const Field<Type>& source() const
|
||||
{
|
||||
return source_;
|
||||
|
@ -48,7 +48,7 @@ Foam::pointField Foam::BSpline::findKnots
|
||||
register scalar oneSixth = 1.0/6.0;
|
||||
register scalar twoThird = 2.0/3.0;
|
||||
|
||||
simpleMatrix<vector> M(newnKnots);
|
||||
simpleMatrix<vector> M(newnKnots, 0, vector::zero);
|
||||
|
||||
// set up the matrix
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user