dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #05581
Re: PETScVector
> On Sat, Oct 13, 2007 at 04:22:18PM +0200, Alessio Quaglino wrote:
>> > I've compiled dolfin using PETSc. After some work, everything finally
>> > compiles, but there was no way to make those working inside
>> PETScVector:
>> >
>> > /// Return value of maximum component of vector
>> > real max() const;
>> >
>> > /// Return value of minimum component of vector
>> > real min() const;
>> >
>> > I thought you wanted to know it, just in case you want to dump them
>> (max
>> > is just the linf norm so it's not even necessary).
>> >
>> > I have also another question: why is uBlas necessary for compiling?
>> > Wouldn'it be (at least in theory) possible to use just PETSc?
>> >
>> > Alessio
>>
>> I'd also like to add that in order to use PETSc functions with dolfin
>> matrices the call Mat() should not be constant (I guess it would be
>> pointless to derive a child class because I'd lose all the private
>> attributes and thus I'd have to copy and paste a lot of code, which is a
>> bad habit).
>
> Does it not compile with the "const"? I think the const on mat() is
> technically correct (we just return a value) but morally questionable
> (since that value is a pointer).
It compiles with the "const", I was questioning the moral implications
though. I'd like to be able to modify the matrix at least using some PETSc
function like (just a random example):
MatMatMult(Mat A,Mat B,MatReuse scall,PetscReal fill,Mat *C)
I've hence added e "non const" ref() which returns the reference of Mat
and can thus be used directly in such functions.
Alessio
> /Anders
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
References