[Trilinos-Users] Epetra_CrsMatrix constructor

Williams, Alan B william at sandia.gov
Tue Mar 16 08:06:06 MDT 2010


John,

Like Mike says, VbrMatrix may be what you need for your 3-dof-per-node problem.

For the issue of owned vs shared, take a look at the FEVbrMatrix. It is constructed with the owned-row map, but then allows coefficient contributions corresponding to the shared-rows.

Alan


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of John Mitchell
> Sent: Monday, March 15, 2010 5:43 PM
> To: trilinos-users at software.sandia.gov
> Subject: Re: [Trilinos-Users] Epetra_CrsMatrix constructor
> 
> After more thought, I have come to realize that this may be even more
> complex when I go to populate the matrix.
> 
> First, I need to have separate RowMap and ColMap for construction of
> the
> Epetra_CrsMatrix since rows will be based upon owned points and columns
> will be based upon owned and shared.
> 
> Then, when I go to populate the matrix for a row, I would have to
> supply
> a 3x3 matrix since I have 3 dofs per element in my maps.
> 
> Any thoughts/feedback would be appreciated.  Thanks,
> John
> 
> John Mitchell wrote:
> > Hi,
> >
> > I'm working on assembly of a matrix for use in a "LinearProblem".
> >
> > I have a set of N points with 3 degrees of freedom per point.
> >
> > int numPoints = N;
> > int ndf = 3;
> > int * globalIds = myIds();
> > Epetra_Comm comm = myCommunicator();
> > Epetra_BlockMap myMap(-1,numPoints, globalIds, ndf, 0,comm);
> >
> > I have successfully used the above map to create Epetra_Vectors and
> do
> > parallel calculations and assemblies.
> >
> > Now I want to create an Epetra_CrsMatrix.  However, I do not find any
> > constructors with "Epetra_BlockMap"  -- there are only constructors
> with
> > Epetra_Map?
> >
> > Does that mean I have to create another map that has 3 times the
> number
> > of entries in it?  Or is there some other approach?  I do notice that
> > there is a constructor using Epetra_CrsGraph.  Is that the route that
> I
> > need to take?
> >
> > As with the Epetra_Vector, it would be really nice to simply use the
> > Epetra_BlockMap for Epetra_CrsMatrix since it has all the information
> > embedded in it.  But if the Epetra_CrsGraph works that is fine too as
> it
> > uses the identical constructor except that it take an
> Epetra_BlockMap.
> >
> > Thanks,
> > John
> >
> >
> >
> >
> >
> > _______________________________________________
> > Trilinos-Users mailing list
> > Trilinos-Users at software.sandia.gov
> > http://software.sandia.gov/mailman/listinfo/trilinos-users
> >
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list