Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

java.lang.ClassCastException when using LiveLink from MATLAB

$
0
0
Hi there,

I've been successfully using COMSOL and LiveLink for a few months now for generating and simulating electromagnetic models.
However, yesterday I ran the same MATLAB code as I always do, but with a different COMSOL mph-file and I got the following error:

=====================
Error using generateSyntheticData (line 76)
Java exception occurred:
Exception:
java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
(rethrown as com.comsol.util.exceptions.FlException)
(rethrown as com.comsol.util.exceptions.FlException)
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
The following feature has encountered a problem

The following feature has encountered a problem

Error in multiphysics compilation
- Feature: Compile Equations: Stationary (sol1/st1)
- Error: Error in multiphysics compilation.

Stack trace:
at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$25.copyValue(CDOTypeImpl.java:585)
...
=====================

The error occurs when the MATLAB line

model.sol('sol1').runAll;

is executed (see attached file generateSyntheticData.m). Can anybody tell me, what the problem is here?
The same code works with many other, almost identical, mph-files that even use finer meshes. So a memory problem is unlikely.
Also the generated/modified mph-file can be simulated/computed perfectly fine in COMSOL itself. Only when being simulated via MATLAB/LiveLink the error occurs. Another strange thing is that just before the above line of code the command

model.sol('sol1').clearSolution;

is successfully executed. So it's not an error in the tag-String 'sol1' either.

I would appreciate any help, because I'm really stuck due to this error. :(

Thanks a lot in advance,
Joerg



Viewing all articles
Browse latest Browse all 26527

Trending Articles