This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to call dolfin.Vector.apply("mode") consistently when using different backends

0 votes

The abstract class Vector defines the method:

virtual void apply(std::string mode)

However, there is some inconsistency between the Trilinos and the PETSc backend.

In fact, the method apply in PETScVector does not check what mode is and simply calls VecAssemblyBegin(_x); and VecAssemblyEnd(_x);.

On the contrary the Trilinos backend does two different reduction operations depending on whether mode = "add" or mode = "insert".

Does PETScVector::apply("unused_string") perform the same reduction operation as `TPetraVector::apply("add")?

If this is the case, should one add an assert in PETScVector::apply that mode is indeed equal to "add"?

Best,

Umbe

asked Sep 8, 2016 by umberto FEniCS User (6,440 points)
...