On 12/05/2012 02:44 PM, John Peterson wrote: > On Wed, Dec 5, 2012 at 12:35 PM, David Knezevic > <dkneze...@seas.harvard.edu> wrote: >> 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? > Hmm... I guess I'd go with a separate method unless you find that > there is too much code duplication? > > I'd never heard of this operation before... how common is it?
How common is "indefinite dot"? Not sure... I just need it because I have some vectors that were already conjugated elsewhere in the code. >> 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? > So is this is a confirmed PETSc bug, or...? Seems like it to me, since MatMultHermitianTranspose doesn't crash for me, but MatMultHermitianTransposeAdd does. But to confirm I guess I should make a "pure PETSc" example, which I haven't got around to doing yet. 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