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 » 11 Nov 2009, 20:23

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 » 12 Nov 2009, 12:09

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: 1135
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: MATC - length limit

Post by annier » 15 Sep 2017, 10:08

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
Department of Materials Engineering, KU Leuven, Belgium

annier
Posts: 1135
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: MATC - length limit

Post by annier » 01 Jan 2018, 20:30

Tutorial on using MATC libraries
1. http://www.training.prace-ri.eu/uploads ... naPipe.pdf
Anil Kunwar
Department of Materials Engineering, KU Leuven, Belgium

Post Reply