← Back to team overview

dolfin team mailing list archive

Re: [HG dolfin] Fix configure and remove some functions from GenericMatrix.

 



Anders Logg wrote:
In GenericMatrix, we have the following functions in addition to the
GenericTensor interface (not counting the virtual functions add, get,
set that are specializations of the corresponding functions in
GenericTensor):

  /// Initialize M x N matrix with given maximum number of nonzeros in each row
  virtual void init(uint M, uint N, uint nzmax) = 0;
/// Initialize M x N matrix with given number of nonzeros per row
  virtual void init(uint M, uint N, const uint nz[]) = 0;

  /// Set all entries to zero
  virtual void zero() = 0;

  /// Set given rows to identity matrix
  virtual void ident(const uint rows[], uint m) = 0;

Since we have init(SparsityPattern), it looks to me like the first two
could be removed.

We should design SparsityPattern such that it doesn't necessarily contain the full layout, but perhaps just the maximum number of non-zeroes. init(SparsityPattern sparsity_pattern) should then initialise a matrix the best way it can with what information sparsity_pattern has.


How about zero() and ident(), do we need them for assembly?

We could say that init() should zero out the matrix and use set()
instead of ident(). Or perhaps we should stick to ident() so we can
map it to MatZeroRowsIS(A, is, one) in PETSc?


We should stick with ident() and use the PETsc function for this.

Ideally, init() will take an argument indicating whether or not the matrix structure has changed,

  init(const SparsityPattern& sparsity_pattern, bool reset = true);

and reset the layout by default. If reset == false, then init() should just zero the matrix and the function zero() can be removed.

Garth



/Anders


On Mon, Apr 16, 2007 at 01:37:15PM +0200, DOLFIN wrote:
One or more new changesets pushed to the primary DOLFIN repository.
A short summary of the last three changesets is included below.

changeset:   2849:25bd777364d1b8bcc1ac36e39089b653d39bf075
tag:         tip
user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
date:        Mon Apr 16 13:37:02 2007 +0200
files:       configure configure.ac src/kernel/la/dolfin/GenericMatrix.h src/kernel/la/dolfin/uBlasMatrix.h
description:
Fix configure and remove some functions from GenericMatrix.


changeset:   2848:42b0e2f7e1698615393798e1f540918d4e571ea9
parent:      2847:6ffac525dc2e8beee3250f45f4da369927b51734
parent:      2846:c7d5e0ce18f10fbff31fb5fa200b61cca062582a
user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
date:        Mon Apr 16 12:53:09 2007 +0200
files: description:
merge


changeset:   2847:6ffac525dc2e8beee3250f45f4da369927b51734
parent:      2844:695032c059f4aed5ee4a2da71ae295607491fa9b
user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
date:        Mon Apr 16 12:52:17 2007 +0200
files:       src/kernel/io/VTKFile.cpp
description:
Small changes in VTKFile.


----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/dolfin
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev





Follow ups

References