[Trilinos-Users] Tpetra for objects (Vol 62, Issue 2)

Mark Hoemmen mhoemme at sandia.gov
Mon Oct 4 11:09:44 MDT 2010


On Oct 2, 2010, at 12:00 PM, trilinos-users-request at software.sandia.gov wrote:
> Message: 1
> Date: Fri, 1 Oct 2010 15:32:57 -0700
> From: "Qiyang Hu" <huqy2000 at gmail.com>
> Subject: [Trilinos-Users] Tpetra for objects
> To: "trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>
> Message-ID:
> 	<AANLkTinuBJfjwH8y4qQYk70QuwxyWHHw-j=vrOLxacHu at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hello,
> 
> I am trying to use Tpetra::MultiVector to serve as a distributed container
> for self-defined objects. According to the document, any data type can be
> used so long as it implements Teuchos::ScalarTraits and
> Teuchos::SerializationTraits. It seems obvious to me for ScalarTraits. But I
> failed to implement SerializationTraits. Is there any example code that I
> can get some hints on it? Thanks so much in advance!

While you might get things to work, it seems like a bad idea to use Tpetra::MultiVector for completely arbitrary objects.  The Tpetra documentation says of Scalar: "A Scalar is the data structure used for storing values. This is the type most likely to be changed by many users. The most common use cases are float, double, complex<float> and complex<double>. However, any data type can be used so long as it implements Teuchos::ScalarTraits and Teuchos::SerializationTraits and supports the necessary arithmetic operations, such as addition, subtraction, division and multiplication."  If those operations don't make sense for your object type, then maybe you should consider some other subclass of Tpetra::DistObject.

mfh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20101004/d4e82ed6/attachment.html 


More information about the Trilinos-Users mailing list