[Trilinos-Users] matrix/vector recipes?

Nico Schlömer nico.schloemer at ua.ac.be
Fri Jan 22 05:22:55 MST 2010


Hi,

> The first is that Vector is a subclass of MultiVector, from which it derives most of its functionality. Unfortunately, the current behavior of the Doxygen webpage is to hide the methods that a derived class inherits from its parent. As a result, if you go to Vector's page, you don't see much. You must either realize that MultiVector is the parent and view MultiVector's page, or click on the "List of all members" link on the Vector page. At which point, you will realize that there is no add() method.
>   
Well, I personally think that the Doxygen site is alright, and the fact
that you need to click on one link to see all members of a class does no
harm.

> The second issue is the balance between providing the functionality that users expect (those operations that are "trivial to describe") and limiting the size of the interface for a class. In the case of Tpetra, there is the further goal, to make Tpetra look as much like Epetra as possible, in order to ease the transition of Epetra users to Tpetra (hence, update() instead of add()). As a result, there is no method MultiVector::add(), and therefore no Vector::add(). One solution to that is to extend the functionality of the classes via non-member arithmetic routines. These are simply wrappers that call the (less numerous) member functions of the Vector class. For example,
> z = Tpetra::add(x,y);
> would allocate a new Vector, which would hold the addition of x and y.
> It has been under discussion for some time to augment Tpetra with a collection of non-member functions. This is similar to the methodology of the Thyra package (in fact, upon renewal of the Thyra/Tpetra adaptors, the Thyra non-member arithmetic interface could be used.) Core development of Tpetra has taken priority, unfortunately. We would be interested in hearing from you, and other Trilinos users, your opinion on this.
>   
I reckon it is not a problem at all that there is no such method "add()"
but "update()", as long as you just know about it. For a Trilinos
newbie, I guess the first thing to try for, e.g., adding two vectors was
to write "v+w", followed by browsing Doxygen. I'm not sure how long it
would take the naive user to find "update" to be the correct choice, but
I feel this may be longer than necessary. Another example along these
lines would be figuring out how to actually access elements of a
Tpetra::Vector, which to my knowledge requires a Teuchos::Array and a
get1dView() call.
Although this syntax is far less semantic than something like " v[5]", I
understand that there are memory implications which make the
complications in code necessary. In my opinion, that's all fine as long
as you actually *know* about it. To date, the one way to learn such
things is the mailing list, which is arguably one of the best ones I
know: Nowhere else you get such quick and competent answers. Still,
there may certainly be more accessible and better structured ways to
organize and publish the knowledge.

> Perhaps Trilinos Framework could chime in on this? Time for an official Trilinos wiki?
>   
I understand that Sandia's policies make it hard to setup a system where
anonymous users can paste what they think is useful.

How do other large-scale open-source projects handle their FAQs? Qt's
website at <http://qt.nokia.com/developer/faqs> may be worth a peek.

After all, a central question may be to what extend user communication
about Trilinos is actually desired. In that sense, it is certainly a
rather strategic than technical decision to be made.

> Regarding the padded matrix, the approach taken will depend on the desired form of the output.
Thanks very much for the explanations, Chris. I haven't had a close look
at Thyra so far, but I'll certainly do so as soon as I have time.

The fully proper solution for my case would actually be to write the
respective LOCA classes to handle the matrix padding (I forgot to
mention I'm dealing with LOCA, sorry). Before writing a full-blown
interface class, I wanted to see if the things that I was going to do
actually worked, say, on a single core setup with dumb direct matrix
padding. As opposed to other numerical software toolkits, I don't always
see a straightforward way in Trilinos to "just quickly try" the one or
the other simple thing before actually attacking it properly.

Cheers,
Nico



More information about the Trilinos-Users mailing list