Skip to content
Snippets Groups Projects
Commit 09aea842 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[BCRSMatrix] Improve logic in setBuildMode() to correctly handle new implicit mode

parent 91caba94
No related branches found
No related tags found
No related merge requests found
......@@ -791,10 +791,15 @@ namespace Dune {
*/
void setBuildMode(BuildMode bm)
{
if(ready==notbuilt)
if (ready == notAllocated)
{
build_mode = bm;
return;
}
if (ready == building && (build_mode == unknown || build_mode == random || build_mode == row_wise) && (bm == row_wise || bm == random))
build_mode = bm;
else
DUNE_THROW(InvalidStateException, "Matrix structure is already built (ready="<<ready<<").");
DUNE_THROW(InvalidStateException, "Matrix structure cannot be changed at this stage anymore (ready == "<<ready<<").");
}
/**
......
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