I tried
b0=gf_mdbrick('generic elliptic',mim,mf, 'matrix');
gf_mesh_fem_set(mf, 'qdim', 4);
A1 = gf_mesh_fem_get(mf, 'eval', {3, 4, 5, 6});
gf_mesh_fem_set(mf, 'qdim', 1);
A1=reshape(A1, 2, 2, 441);
and it seems to work well.
Yves.
Quoting Julien Pommier <[EMAIL PROTECTED]>:
> Hi Marco,
>
> I have just committed a patch (
> http://svn.gna.org/viewcvs/getfem?rev=2828&view=rev ) that should fix your
> problem.
>
> Julien
>
>
> Quoting marco trevisan <[EMAIL PROTECTED]>:
>
>> Hello!
>> I still cannot find my way through this (presumably easy) problem of
>> coefficient definition, so I guess the best thing to do is post a tiny
>> snippet of the code:
>>
>> base = gf_mdbrick('generic elliptic',mim,mf,'matrix');
>> gf_mdbrick_set(base,'param','A',mf, A1);
>>
>> now, which size should the matrix field A1 be?
>> The mesh has 121 nodes (same as the dofs), the problem is scalar on a
>> 2D domain, and I have tried almost every possible reshaping of these
>> 4x121=484 numbers with no effect.
>>
>> example of error outputs:
>>
>> "??? wrong size for the parameter A, expected an array of size 0x0x121
>> ( or 0x0 for a constant field), got an array of size 1x484"
>> "??? wrong size for the parameter A, expected an array of size 0x0x121
>> ( or 0x0 for a constant field), got an array of size 4x121"
>>
>> finally I entered a 0x0x121 matrix just to see the output:
>>
>> "??? Error in ../../src/getfem/getfem_modeling.h, line 696 void
>> getfem::mdbrick_parameter<VEC>::check() const [with VEC =
>> getfem::modeling_standard_plain_vector]:
>> invalid dimension for brick parameter 'A', expected an array of size
>> 484=4x121, got an array of size 0"
>>
>> Any tips?
>> Thank you in advance
>>
>> marco trevisan
>>
>> _______________________________________________
>> Getfem-users mailing list
>> [email protected]
>> https://mail.gna.org/listinfo/getfem-users
>>
>
>
>
>
> _______________________________________________
> Getfem-users mailing list
> [email protected]
> https://mail.gna.org/listinfo/getfem-users
>
_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users