[Trilinos-Users] examples from tutorial

Malte Neumann neumann@statik.uni-stuttgart.de
Thu, 4 Mar 2004 18:49:30 +0100


Hi Alan,

thanks a lot for this hint, now (almost) everything is working well. I so
far manage to build the system matrix and the rhs vector and then solve the
system using AztecOO and even get the correct result. ;-)

I only found one minor problem:
I first tried to construct the AztecOO object using an Epetra_LinearProblem.
All checkInpit functions (for the LinearProblem and the AztecOO) return 0,
but iterating on the Aztec object fails on line 602 of AztecOO.cpp.
Using the default contructor for AztecOO (without arguments) and then
setting the matrix and vectors using the set-functions of AztecOO works well.
But maybe this is not a problem of the LinearProblem and OT on this list.

Malte


Mike, 
if you like, I can send you the c-wrappers when I am finished with this
project.


On Wed, Mar 03, 2004 at 09:24:43AM -0700, Williams, Alan B wrote:
> Hi Malte,
> 
> The return-code of 2 is coming from the underlying CrsMatrix (which is the
> base class for FECrsMatrix). When CrsMatrix::SumIntoGlobalValues is called
> for matrix positions that don't yet exist, it is an error. To input data
> for matrix positions that don't yet exist, it is necessary to use the
> method InsertGlobalValues.
> 
> We have debated whether this is the best behavior, since it would be
> natural for finite-element matrix assembly to use SumIntoGlobalValues for
> the whole matrix, from the beginning.
> 
> An alternative is to pre-construct the graph of your matrix (using a
> CrsGraph object) and construct a FECrsMatrix with that graph. Then
> SumIntoGlobalValues can be used.
> 
> Alan
> 
> 
> > -----Original Message-----
> > From: Malte Neumann [mailto:neumann@statik.uni-stuttgart.de]
> > Sent: Wednesday, March 03, 2004 8:09 AM
> > To: Michael A Heroux
> > Cc: trilinos-users
> > Subject: Re: [Trilinos-Users] examples from tutorial
> > 
> > 
> > Mike,
> > 
> > Thanks a lot for your wrappers. They are easy to use and helped me a lot
> > at the beginning.
> > 
> > But now I am stuck in the assembling of a FECrs_Matrix and don't know
> > what else to try. This is what I have done so far: (see the attached
> > modified c_main.c)
> > 
> > 
> > No matter what I do this function always returns 2, even when defining
> > the parameters directly in the c_wrapper and not passing them from c to
> > cpp.
> > 
> > Where is my mistake??  Did I misunderstand the whole concept of the
> > FECrsMatrix or it just a problem of hte usage??
> > 
> > Thank you very much for your advice.
> > 
> > Malte
> > 
> > 
> > On Mon, Mar 01, 2004 at 05:06:29PM -0600, Michael A Heroux wrote:
> > > Malte,
> > > 
> > > I have attached the Epetra_C_wrappers files.  They are
> > > works-in-progress and represent only one way to try to wrap C++ in a C
> > > interface.  Note that these files are heavily parametrized because
> > > they also provide the Fortran wrappers by defining a Fortran flag.
> > > 
> > > These files wrap a small subset of the classes and methods that Epetra
> > > provides, but hopefully you can extend them to the set of classes and
> > > methods you need.
> > > 
> > > I have attached a sample program that illustrates how to call Epetra
> > > from C.  This test driver does work with the development branch of
> > > Epetra, but should also work with the release branch.
> > > 
> > > Mike
> > > 
> > > > -----Original Message----- From: Malte Neumann
> > > > [mailto:neumann@statik.uni-stuttgart.de] Sent: Friday, 
> > > > February 27, 2004
> > > > 3:28 AM To: trilinos-users Cc: Michael A Heroux Subject: Re:
> > > > [Trilinos-Users] examples from tutorial
> > > >
> > > >
> > > > Mike,
> > > >
> > > > thanks a lot for the link to the examples. I think they are quite
> > > > helpful.
> > > >
> > > > Regarding the C wrappers, I believe they would help me a lot as a
> > > > starting point, so I would be grateful if you could send 
> > > > them to me.
> > > >
> > > > Thanks for your help
> > > >
> > > > Malte
> > > >
> > > >
> > > > On Thu, Feb 26, 2004 at 04:57:58PM -0600, Michael A Heroux wrote:
> > > > > Malte,
> > > > >
> > > > > The examples are not part of the standard distribution.  They are
> > > > > available from the following URL:
> > > > >
> > > > > http://www.cs.sandia.gov/~mheroux/examples.tar.gz
> > > > >
> > > > > Regarding the C wrappers, they are not part of this release and
> > > > > are not fully developed at this point.  Our C user base is very
> > > > > small right now and has tended to provide their own links to the
> > > > > C++ libraries up to now, so I am not sure that our C interfaces
> > > > > will be ready for outside use for some time.  If you are
> > > > > interested in what we have, please let me know and I can send them
> > > > > to you.
> > > > >
> > > > > Mike
> > > > >
> > > > > > -----Original Message----- From:
> > > > > > trilinos-users-admin@software.sandia.gov
> > > > > > [mailto:trilinos-users-admin@software.sandia.gov]On Behalf Of
> > > > > > Malte Neumann Sent: Thursday, February 26, 2004 11:19 AM To:
> > > > > > Trilinos-Users@software.sandia.gov Subject: [Trilinos-Users]
> > > > > > examples from tutorial
> > > > > >
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I am trying to use Trilinos (especially Epetra, AztecOO and ML)
> > > > > > in our FE-code. I have two questions:
> > > > > >
> > > > > > 1. I am not able to find the code for the examples as stated in
> > > > > > the Trilinos Tutorial (SAND2004-0154). The directory doc does
> > > > > > not exist in my trilinos directory. Where can I find these
> > > > > > examples?
> > > > > >
> > > > > > 2. I would like to use the c wrapper functions to use Epetra
> > > > > > objects from our existing c code. Where can I find further
> > > > > > information about these c functions, examples on the usage etc.
> > > > > >
> > > > > > Thank you very much for your advice.
> > > > > >
> > > > > > regards
> > > > > >
> > > > > > Malte Neumann

-- 
--------------------------------------------------------------------------
                              Malte Neumann
--------------------------------------------------------------------------
Institut fuer Baustatik / Institute of Structural Mechanics       
Prof. Dr.-Ing. Ekkehard Ramm                        
Universitaet Stuttgart / University of Stuttgart          
                                 
Pfaffenwaldring 7, D-70550 Stuttgart, Germany

mailto:neumann@statik.uni-stuttgart.de            phone: ++49-711-685-6121
http://www.uni-stuttgart.de/ibs/members/neumann/  fax:   ++49-711-685-6130
--------------------------------------------------------------------------