Mike
as long as P is a sparse matrix with compatible rows and cols (i.e. rows(P)= cols(A) = rows (A)) , MatPtAP will compute the result.
Stefano and Mark are correct. This will work.
I implemented the same thing in my code in a different way. I put this transformation into the mapping between local and global vector spaces. The global degrees of
freedom are the ones you want for boundary conditions (normal and tangential to the boundary), and I eliminate the ones that are constrained. The local degrees of
freedom are the normal Caresian ones, and these are used for assembly. The map is used when I execute DMGlobalToLocal() and DMLocalToGlobal(). There is an
example of me doing this in SNES ex71, Poiseuille flow in a tilted channel.
Thanks,
Matt
Il giorno lun 31 mag 2021 alle ore 16:52 Mark Adams <
mfadams@lbl.gov> ha scritto:
Hi PETSc team:
Or you may find the method in the attached Bathe's slides, pages 9 -10.
Roughly speaking, a (very) sparse matrix T will be created which takes the shape [ I, O; O, R], where R is a 3x3 rotation matrix. And the original linear problem K U = F will be modified into (T^t K T) (T^t U) = T^t F. In doing so, one can enforce a roller boundary condition on a slanted surface.
Yes, and no. It is motivated and optimized for a Galerkin coarse grid operator for AMG solvers, but it is a projection and it should be fine. If not, we will fix it.
We try to test our methods of "empty" operators , but I don't know if MatPtAP has ever been tested for super sparse P. Give it a shot and see what happens.
Mark
I assume I can only call MatMatMult & MatTransposeMatMult to do this job, correct? Is there any existingly PETSc function to do T^t K T in one call?
Thanks,
Mike
--
Stefano