Skip to content

A warning fix in NormalTractionBoundaryConditionLocalAssembler

wenqing requested to merge wenqing/ogs:fix_warning into master

NormalTractionBoundaryConditionLocalAssembler is created for dimension=1, 2, 3 in createLocalAssemblers. respectively. For the case of dimension=1, there is an out of vector bound warning as given below. Actually, NormalTractionBoundaryCondition is only for 2 or 3D problems.

NormalTractionBoundaryConditionLocalAssembler.h:92:31: warning: array subscript 1 is outside array bounds of ‘ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler<NumLib::ShapeLine3, NumLib::IntegrationGaussLegendreRegular<1>, 1>::GlobalDimVectorType [1]’ {aka ‘Eigen::Matrix<double, 1, 1, 0, 1, 1> [1]’} [-Warray-bounds]
   92 |             element_normal[1] = v1[0];//
/home/wenqing/Code/ogs6/sources/ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h:84:29: note: while referencing ‘element_normal’
   84 |         GlobalDimVectorType element_normal(GlobalDim);

See the source code where the warning occurs.

Merge request reports