How to initialize a matrix without a dofmap?

Asked by Kent-Andre Mardal

How should I initialize a matrix without a dofmap?
It seems that the resize function is taken away. Also the read function is removed.

Kent

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

On May 10 2011, Kent-Andre Mardal wrote:

>New question #156844 on DOLFIN:
>https://answers.launchpad.net/dolfin/+question/156844
>
>
> How should I initialize a matrix without a dofmap?

You can create a Matrix,

  Matrix A

but it must be initialised using a sparsity pattern. Sparse matrices are
not properly defined by dimensions only, some backends do not support this,
and using dimensions is basically useless in parallel,

If you want a dense matrix, or one that does not require a sparsity
pattern, you can use a backend that supports this, e.g. uBLASMatrix.

> It seems that the
> resize function is taken away. Also the read function is removed.
>

Which 'read' function are you referring to? I don't think that there was
ever a GenericMatrix::read function.

Garth

>Kent
>
>

Revision history for this message
Kent-Andre Mardal (kent-and) said :
#2

On 10 May 2011 09:27, Garth N. Wells <email address hidden> wrote:

> On May 10 2011, Kent-Andre Mardal wrote:
>
> New question #156844 on DOLFIN:
>> https://answers.launchpad.net/dolfin/+question/156844
>>
>>
>> How should I initialize a matrix without a dofmap?
>>
>
> You can create a Matrix,
>
> Matrix A
>
> but it must be initialised using a sparsity pattern. Sparse matrices are
> not properly defined by dimensions only, some backends do not support this,
> and using dimensions is basically useless in parallel,
>
> If you want a dense matrix, or one that does not require a sparsity
> pattern, you can use a backend that supports this, e.g. uBLASMatrix.
>
>
The matrix is sparse, but I want to do it all by hand :) The reason is that
I have two different meshes.

>
> It seems that the resize function is taken away. Also the read function is
>> removed.
>>
>>
> Which 'read' function are you referring to? I don't think that there was
> ever a GenericMatrix::read function.
>
> Garth
>

I meant the read from file function.

Kent

Revision history for this message
Garth Wells (garth-wells) said :
#3

On 10/05/11 08:35, Kent-Andre Mardal wrote:
>
>
> On 10 May 2011 09:27, Garth N. Wells <<email address hidden>
> <mailto:<email address hidden>>> wrote:
>
> On May 10 2011, Kent-Andre Mardal wrote:
>
> New question #156844 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/156844
>
>
> How should I initialize a matrix without a dofmap?
>
>
> You can create a Matrix,
>
> Matrix A
>
> but it must be initialised using a sparsity pattern. Sparse matrices
> are not properly defined by dimensions only, some backends do not
> support this, and using dimensions is basically useless in parallel,
>
> If you want a dense matrix, or one that does not require a sparsity
> pattern, you can use a backend that supports this, e.g. uBLASMatrix.
>
>
> The matrix is sparse, but I want to do it all by hand :) The reason is
> that I have two different meshes.
>

Use uBLASMatrix (uBLASSparseMatrix) or MTL4Matrix. They support random
insertion into sparse matrices.

>
>
> It seems that the resize function is taken away. Also the read
> function is removed.
>
>
> Which 'read' function are you referring to? I don't think that there
> was ever a GenericMatrix::read function.
>
> Garth
>
>
> I meant the read from file function.
>

File io needs major revision.

Garth

> Kent
>

Can you help with this problem?

Provide an answer of your own, or ask Kent-Andre Mardal for more information if necessary.

To post a message you must log in.