← Back to team overview

dolfin team mailing list archive

Re: [Question #95908]: Error: Invalid value rank for coefficient 1

 

Phil Marinier wrote:
New question #95908 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/95908

I hope this isn't a stupid question, but I have get this error message and I have no idea what it means.

Solving linear variational problem
  Matrix of size 1251 x 1251 has 8551 nonzero entries.
terminate called after throwing an instance of 'std::runtime_error'
  what():  *** Error: Invalid value rank for coefficient 1, got 1 but expecting 0. Did you forget to specify the value rank correctly in an Expression sub class?
[wolf:00486] *** Process received signal ***
[wolf:00486] Signal: Aborted (6)
[wolf:00486] Signal code:  (-6)
[wolf:00486] [ 0] [0xe99410]
[wolf:00486] [ 1] [0xe99422]
[wolf:00486] [ 2] /lib/tls/i686/cmov/libc.so.6(gsignal+0x51) [0x78b84d1]
[wolf:00486] [ 3] /lib/tls/i686/cmov/libc.so.6(abort+0x182) [0x78bb932]
[wolf:00486] [ 4] /usr/lib/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x14f) [0x1d034df]
[wolf:00486] [ 5] /usr/lib/libstdc++.so.6 [0x1d01415]
[wolf:00486] [ 6] /usr/lib/libstdc++.so.6 [0x1d01452]
[wolf:00486] [ 7] /usr/lib/libstdc++.so.6 [0x1d01591]
[wolf:00486] [ 8] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZNK6dolfin6Logger5errorESs+0x98) [0x477fb8]
[wolf:00486] [ 9] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin5errorESsz+0x9f) [0x47f92f]
[wolf:00486] [10] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin14AssemblerTools5checkERKNS_4FormE+0x18f) [0x39fd9f]
[wolf:00486] [11] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin9Assembler8assembleERNS_13GenericTensorERKNS_4FormEPKNS_12MeshFunctionIjEES9_S9_bb+0x3c) [0x3b774c]
[wolf:00486] [12] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin8assembleERNS_13GenericTensorERKNS_4FormEPKNS_12MeshFunctionIjEES8_S8_bb+0x49) [0x3a4c29]
[wolf:00486] [13] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin18VariationalProblem12solve_linearERNS_8FunctionE+0x829) [0x399ff9]
[wolf:00486] [14] /home/claude/FEniCS/build/lib/libdolfin.so.0(_ZN6dolfin18VariationalProblem5solveERNS_8FunctionE+0x2a) [0x39a95a]
[wolf:00486] [15] ./forward(_ZN7ASolver5solveEPN6dolfin8FunctionES2_PdS3_S3_ddP4Edge+0xb9f) [0x80965cf]
[wolf:00486] [16] ./forward(_ZN9Fiterator5solveEPdS0_S0_+0x12d2) [0x80819c2]
[wolf:00486] [17] ./forward(main+0x82d) [0x807002d]
[wolf:00486] [18] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x78a4b56]
[wolf:00486] [19] ./forward [0x806e931]
[wolf:00486] *** End of error message ***
Aborted


I'm not using any sub classes of Expression. I am using dolfin::Function but as far as I know, I don't have to specify the value rank when using Function. What does this error message mean? I am using MeshFunction but I double checked the new programmers reference and I'm declaring it the right way, and it doesn't seem to need a value rank. What should I be looking for when I debug?


I think this might happens like the following: your function space which you define the function from is different in your cpp code and in a ufl form file. For example

W = new YourForm::FunctionSpace(mesh) //it might not much to the function space in YourForm.ufl
Function w(*W);  //


You can print out the size of the vector w.vector() to check.

murtazo



Follow ups

References