PetscVector::dot calls VecDot, which does a conjugate-transpose in the 
complex-valued case. I also need to be able to do non-conjugated dot 
products, which are referred to as "indefinite" dot products in PETSc 
and are implemented in VecTDot.

So I'd like to add an indefinite dot-product to libMesh. Any thoughts on 
the API? A separate "indefinite_dot" method in NumericVector? Or a 
boolean argument (with default value to maintain API backwards 
compatibility) in the existing dot method?



Also, on a related note, I posted to libmesh-users about 
add_vector_tranpose and how I'd like it to do a conjugate-tranpose in 
the complex-valued case (perhaps toggled with an optional boolean 
argument as above?). This works with the following code:

#ifndef LIBMESH_USE_COMPLEX_NUMBERS
   // The const_cast<> is not elegant, but it is required since PETSc
   // is not const-correct.
   ierr = MatMultTransposeAdd(const_cast<PetscMatrix<T>*>(A)->mat(), 
V->_vec, _vec, _vec);
   CHKERRABORT(libMesh::COMM_WORLD,ierr);
#else
   // Store a temporary copy since MatMultHermitianTransposeAdd doesn't 
seem to work
   AutoPtr< NumericVector<Number> > this_clone = this->clone();

   // The const_cast<> is not elegant, but it is required since PETSc
   // is not const-correct.
   ierr = 
MatMultHermitianTranspose(const_cast<PetscMatrix<T>*>(A)->mat(), 
V->_vec, _vec);
   CHKERRABORT(libMesh::COMM_WORLD,ierr);

   // Add the temporary copy to the matvec result
   this->add(1., *this_clone);
#endif

i.e. I had to make a temporary vector to get this to work since 
MatMultHermitianTransposeAdd doesn't seem to work. OK if I check that 
in, with a TODO note about getting to the bottom of the 
MatMultHermitianTransposeAdd issue?

David


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to