[kernel] fix issue in boundary conditions
@@ -453,21 +453,29 @@ void MoreauJeanOSI::_computeWBoundaryConditions(SecondOrderDS& ds,
SecondOrderDS& d = static_cast<SecondOrderDS&>(ds);
SP::BoundaryCondition bc = d.boundaryConditions();
- for(itindex = bc->velocityIndices()->begin() ;
- itindex != bc->velocityIndices()->end();
- ++itindex)
- {
- if(!iteration_matrix.checkSymmetry(1e-10))
+ if(!iteration_matrix.checkSymmetry(1e-10)) // Warning this operation could be quite expensive
{
// iteration_matrix.display();
std::cout <<"Warning, we apply boundary conditions assuming W symmetric" << std::endl;
}
+
+ for(itindex = bc->velocityIndices()->begin() ;
+ itindex != bc->velocityIndices()->end();
+ ++itindex)
+ {
iteration_matrix.getCol(*itindex, *columntmp);
/*\warning we assume that W is symmetric
we store only the column and not the row */
-
WBoundaryConditions.setCol(columnindex, *columntmp);
- double diag = (*columntmp)(*itindex);
+ columnindex ++;
+ }
+
+ columnindex = 0;
+ for(itindex = bc->velocityIndices()->begin() ;
+ itindex != bc->velocityIndices()->end();
+ ++itindex)
+ {
+ double diag = iteration_matrix.getValue(*itindex,*itindex);
columntmp->zero();
(*columntmp)(*itindex) = diag;
iteration_matrix.setCol(*itindex, *columntmp);
