MATC - length limit

Numerical methods and mathematical models of Elmer
Post Reply
mulvrova
Posts: 63
Joined: 04 Sep 2009, 10:48

MATC - length limit

Post by mulvrova »

Hello,

is there any limit for the length of MATC expression? is it possible to get around it?

Martina.
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: MATC - length limit

Post by Juha »

Hi,

there is a limit of 16 K characters within the .sif file of a matc expression using the
$ blah blah
format. MATC itself has a 4 K character buffer for an expression (in line ~94 in
matc/src/parser.c). It should be relatively easy to replace this by a dynamic
allocation, or at least increase the size, see below however.

Also, the runtime evaluated MATC string (param= variable x; real matc "blah blah")
is stored in a string of length 128 characters. The latter could of course use functions and
variables defined with the former (each of length 4K chars), so that in practice there
should be no hard limits ?

Regards, Juha
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: MATC - length limit

Post by annier »

Juha wrote:Also, the runtime evaluated MATC string (param= variable x; real matc "blah blah")
is stored in a string of length 128 characters. The latter could of course use functions and
variables defined with the former (each of length 4K chars), so that in practice there
should be no hard limits ?
An example for this wonderful answer by Juha is given at viewtopic.php?f=3&t=4070&start=0&hilit= ... 15d68dccae

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: MATC - length limit

Post by annier »

Tutorial on using MATC libraries
1. http://www.training.prace-ri.eu/uploads ... naPipe.pdf
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Post Reply