Skip to content
Snippets Groups Projects
Commit a68a8639 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[T] use new matrix specs

parent 7a12f9e5
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
MathLib::MatrixSpecifications getMatrixSpecifications() const override MathLib::MatrixSpecifications getMatrixSpecifications() const override
{ {
return { N, N }; return { N, N, nullptr, nullptr, nullptr };
} }
bool isLinear() const override bool isLinear() const override
...@@ -73,12 +73,14 @@ public: ...@@ -73,12 +73,14 @@ public:
static void setIC(Vector& x0) static void setIC(Vector& x0)
{ {
MathLib::setVector(x0, { 1.0, 0.0 }); MathLib::setVector(x0, { 1.0, 0.0 });
MathLib::BLAS::finalizeAssembly(x0);
} }
static Vector solution(const double t) static Vector solution(const double t)
{ {
Vector v(2); Vector v(2);
MathLib::setVector(v, { cos(t), sin(t) }); MathLib::setVector(v, { cos(t), sin(t) });
MathLib::BLAS::finalizeAssembly(v);
return v; return v;
} }
...@@ -123,12 +125,15 @@ public: ...@@ -123,12 +125,15 @@ public:
MathLib::addToMatrix(Jac, N, N, { x[0] }); // add dK_dx MathLib::addToMatrix(Jac, N, N, { x[0] }); // add dK_dx
if (dx_dx != 0.0) if (dx_dx != 0.0)
{
BLAS::finalizeAssembly(Jac);
BLAS::axpy(Jac, dx_dx, K); BLAS::axpy(Jac, dx_dx, K);
}
} }
MathLib::MatrixSpecifications getMatrixSpecifications() const override MathLib::MatrixSpecifications getMatrixSpecifications() const override
{ {
return { N, N }; return { N, N, nullptr, nullptr, nullptr };
} }
bool isLinear() const override bool isLinear() const override
...@@ -146,12 +151,14 @@ public: ...@@ -146,12 +151,14 @@ public:
static void setIC(Vector& x0) static void setIC(Vector& x0)
{ {
MathLib::setVector(x0, { 1.0 }); MathLib::setVector(x0, { 1.0 });
MathLib::BLAS::finalizeAssembly(x0);
} }
static Vector solution(const double t) static Vector solution(const double t)
{ {
Vector v(1); Vector v(1);
MathLib::setVector(v, { 1.0/t }); MathLib::setVector(v, { 1.0/t });
MathLib::BLAS::finalizeAssembly(v);
return v; return v;
} }
...@@ -264,7 +271,7 @@ public: ...@@ -264,7 +271,7 @@ public:
MathLib::MatrixSpecifications getMatrixSpecifications() const override MathLib::MatrixSpecifications getMatrixSpecifications() const override
{ {
return { N, N }; return { N, N, nullptr, nullptr, nullptr };
} }
bool isLinear() const override bool isLinear() const override
...@@ -291,6 +298,7 @@ public: ...@@ -291,6 +298,7 @@ public:
MathLib::setVector(x0, { sin(omega*t0)/omega/t0, MathLib::setVector(x0, { sin(omega*t0)/omega/t0,
1.0/t0, 1.0/t0,
cos(omega*t0) }); cos(omega*t0) });
MathLib::BLAS::finalizeAssembly(x0);
// std::cout << "IC:\n" << Eigen::VectorXd(x0.getRawVector()) << "\n"; // std::cout << "IC:\n" << Eigen::VectorXd(x0.getRawVector()) << "\n";
} }
...@@ -303,6 +311,7 @@ public: ...@@ -303,6 +311,7 @@ public:
MathLib::setVector(v, { sin(omega*t)/omega/t, MathLib::setVector(v, { sin(omega*t)/omega/t,
1.0/t, 1.0/t,
cos(omega*t) }); cos(omega*t) });
MathLib::BLAS::finalizeAssembly(v);
return v; return v;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment