On Wed, 15 Sep 2010, Jed Brown wrote:
> On Wed, 15 Sep 2010 14:53:18 +0200 (CEST), Tim Kroeger
> <[email protected]> wrote:
>
>>> This chooses the sizes of each part, but you will still have to move
>>> indices around.
>>
>> This is done by VecScatter, isn't it? I think that the overhead of
>> doing this once before and after the solve will be small against the
>> gain in performance by having balanced vectors. Well, of course this
>> depends on a lot of things, but in the mean...
>
> VecScatter moves entries around, and isn't the issue here.
> Redistributing indices to satisfy some a-priori size bound is somewhat
> different (though not hard).
So do I have to do something additional or not? I would think that I
don't have to, because VecSetSizes() should be able to divide the
index range {0,...,N-1} into k (almost) equally wide intervals itself.
>> + size_t _solve_only_on_is_size(void)const;
>
> Note that you only call this once.
Right for now, but I will later call it once in every overloaded
solve() method.
>> + ierr = MatGetSubMatrix(matrix->mat(),
>> + _solve_only_on_is_local,_solve_only_on_is,
>> + PETSC_DECIDE,MAT_INITIAL_MATRIX,&submat);
>> + CHKERRABORT(libMesh::COMM_WORLD,ierr);
>
> Why do you want this non-square matrix? I'm pretty sure you want to
> extract the symmetric block (_solve_only_on_is,_solve_only_on_is).
That's what I had here before, but as far as I understood you before,
this would result in duplicating the complete matrix over all
processors.
>> + ierr =
>> VecScatterBegin(scatter,subsolution,solution->vec(),INSERT_VALUES,SCATTER_REVERSE);
>> + CHKERRABORT(libMesh::COMM_WORLD,ierr);
>> + ierr =
>> VecScatterEnd(scatter,subsolution,solution->vec(),INSERT_VALUES,SCATTER_REVERSE);
>> + CHKERRABORT(libMesh::COMM_WORLD,ierr);
>
> You probably want to set the rest of solution->vec() to the right side,
> or zero it out, otherwise a solve is not a linear operation. The reason
> for the first is that it makes the preconditioner look like the
> submatrix was extended to operate on the full domain using the identity
> (instead of zero which would make it very singular).
You're right in that my current implementation makes solve not be a
linear operation if considered on the complete vector. But what I
want is some operation that only works on a subset of the dofs, where
the same subset applies to the rhs and the solution. On this subset,
solve is a linear operation, and the dofs outside the subset just
don't take part in the operation at all, that is, they are kept
constant. At least, in my application that's what I need.
Best Regards,
Tim
--
Dr. Tim Kroeger
CeVis -- Center of Complex Systems and Visualization
University of Bremen [email protected]
Universitaetsallee 29 [email protected]
D-28359 Bremen Phone +49-421-218-7710
Germany Fax +49-421-218-4236
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users