Commit 521a310 1 parent ed9dc2f commit 521a310 Copy full SHA for 521a310
File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,9 @@ FoamFile
116
116
// inverse can have. Only change if you know what you
117
117
// are doing!
118
118
119
+ checkCondition false ;// Check the condition of the pseudo inverse matrix
120
+ // If the central stencil has at least one zero entry
121
+ // the matrix is removed for all stencils of this cell.
119
122
// ************************************************************************* /
120
123
```
121
124
Original file line number Diff line number Diff line change @@ -548,10 +548,16 @@ Foam::scalarRectangularMatrix Foam::WENOBase::calcMatrix
548
548
549
549
scalarRectangularMatrix AInv = svdCurrPtr -> VSinvUt ();
550
550
551
- if (stencilI == 0 && svdCurrPtr -> nZeros () != 0 )
551
+ if (checkCondition_ && stencilI == 0 && svdCurrPtr -> nZeros () != 0 )
552
552
{
553
553
deleteStencil (localCellI ,stencilI );
554
554
stencilsID_ [localCellI ][stencilI ][0 ] = int (Cell ::empty );
555
+ return scalarRectangularMatrix
556
+ (
557
+ nDvt_ ,
558
+ nCells ,
559
+ scalar (0.0 )
560
+ );
555
561
}
556
562
557
563
if (AInv .n () != stencilSize - 1 )
@@ -697,6 +703,8 @@ Foam::WENOBase::WENOBase
697
703
698
704
maxCondition_ = WENODict .lookupOrAddDefault < scalar > ("maxCondition" ,1e-05 );
699
705
706
+ checkCondition_ = WENODict .lookupOrAddDefault < Switch > ("checkCondition" ,true);
707
+
700
708
// ------------- Initialize Lists --------------------------------------
701
709
702
710
stencilsID_ .setSize (localMesh .nCells ());
@@ -773,7 +781,8 @@ Foam::WENOBase::WENOBase
773
781
774
782
}
775
783
776
- LSMatrixCheck ();
784
+ if (checkCondition_ )
785
+ LSMatrixCheck ();
777
786
778
787
779
788
Info << "\t5) Calcualte smoothness indicator B..." <<endl ;
Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ class WENOBase
168
168
// - Lists of oscillation matrices for each stencil of each cell
169
169
List<geometryWENO::DynamicMatrix> B_;
170
170
171
+ // - Switch to check the condition of the first stencil of the
172
+ // pseudo inverse matrices.
173
+ // If true it removes the matrix if the central stencil has at least
174
+ // one zero entry. (Default is true)
175
+ Switch checkCondition_;
171
176
172
177
// - Private member functions
173
178
You can’t perform that action at this time.
0 commit comments