CIFASIS / CIFASIS/qss-solver

Check array function inputs.

Open
#254 0 comments 0 reactions 1 assignee Claimed by @joaquinffernandez View on GitHub
bug
Dominant language
C
Stars
37
Forks
11
PR merge metrics
No merged PRs in 30d

Description

*Bug**
We are getting compile time errors in defs like:

```
model array_params

constant Integer N = 10;

Real x[N];
discrete Real d;
parameter Real p[N];

function F
input Real x[:];
output Real y;
external "C" y = sample(x) annotation(
Include="#include \"array_params.c\"");
end F;

initial algorithm
d := F(p);

equation
for i in 1:N loop
der(x[i]) = 1;
end for;

algorithm

when time > 1 then
d := F(x);
end when;
annotation(

experiment(
MMO_Description="",
MMO_Solver=QSS3,
MMO_PartitionMethod=Metis,
Jacobian=Dense,
MMO_BDF_PDepth=1,
MMO_BDF_Max_Step=0,
StartTime=0.0,
StopTime=1.0,
Tolerance={1e-3},
AbsTolerance={1e-3}
));
end array_params;
```

with `array_params.c`:

```
int sample(double* arr) {
return arr[0];
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.