Commit 9a0ac613 authored by Timo Koch's avatar Timo Koch
Browse files

[fvproblem] Resize the solution vector before applying initial solution

parent f7b6f06d
......@@ -571,6 +571,7 @@ private:
{
const auto numDofs = fvGridGeometry_->vertexMapper().size();
const auto numVert = fvGridGeometry_->gridView().size(dim);
sol.resize(numDofs);
// if there are more dofs than vertices (enriched nodal dofs), we have to
// call initial for all dofs at the nodes, coming from all neighboring elements.
......@@ -609,6 +610,7 @@ private:
*/
void applyInitialSolutionImpl_(SolutionVector& sol, /*isBox=*/std::false_type) const
{
sol.resize(fvGridGeometry_->numDofs());
for (const auto& element : elements(fvGridGeometry_->gridView()))
{
const auto dofIdxGlobal = fvGridGeometry_->elementMapper().index(element);
......
......@@ -164,6 +164,9 @@ public:
*/
void applyInitialSolution(SolutionVector& sol) const
{
sol[cellCenterIdx].resize(this->fvGridGeometry().numCellCenterDofs());
sol[faceIdx].resize(this->fvGridGeometry().numFaceDofs());
for (const auto& element : elements(this->fvGridGeometry().gridView()))
{
auto fvGeometry = localView(this->fvGridGeometry());
......
Supports Markdown
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