Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Is it possible to use several model objects in the Matlab workspace?

Please login with a confirmed email address before reporting spam

Hello,

did somebody already use several Comsol 4.1 model objects in the Matlab Workspace? (I do not want to
add model objects to a parent model object.)

In Comsol 3.5a I could save all my resulting fem structures (from a batch simulation) in a Matlab structure.

dat.fems{1,1} = fem1
dat.fems{1,2} = fem2

...

If I try to work with several Comsol 4.1 model objects, I get the error message attached below. Do I have to somehow trigger/update the "ModelUtil" or the "com.comsol.model.clientserver" if i want to change the current model ?

Here is an example workflow:
- create modelA and save it in the Matlab workspace as dat.modelA
- create modelB and save it in the Matlab workspace as dat.modelB
- try to save dat.modelA with dat.modelA.save('test.mph')

=> error:

??? Java exception occurred:
Exception:
org.eclipse.net4j.util.transaction.TransactionException: java.lang.NullPointerException
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Error during client transaction


Stack trace:

at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:642)

at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:653)

at com.comsol.model.clientserver.ClientManagerImpl.commit(Unknown Source)

at com.comsol.model.clientserver.ClientManagerImpl.a(Unknown Source)

at com.comsol.model.clientserver.ClientManagerImpl.runServerJob(Unknown Source)

at com.comsol.model.impl.SolverSequenceImpl.getSize(Unknown Source)

Caused by: java.lang.NullPointerException

at org.eclipse.emf.internal.cdo.util.FSMUtil.adapt(FSMUtil.java:119)

at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.getURIFragment(CDOResourceImpl.java:571)

at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2899)

at org.eclipse.emf.internal.cdo.view.CDOViewImpl.provideCDOID(CDOViewImpl.java:933)

at org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision.writeValues(AbstractCDORevision.java:653)

at org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision.write(AbstractCDORevision.java:168)

at org.eclipse.emf.cdo.internal.common.io.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:160)

at
org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionRequest.writeRevisions(CommitTransactionRequest.java:313)

at
org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:215)

at org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:163)

at org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:103)

at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:163)

at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:117)

at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:281)

at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:102)

at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:233)

at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:66)

at org.eclipse.net4j.signal.Signal.runSync(Signal.java:238)

at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:427)

at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87)

at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73)

at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:108)

at org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:302)

at org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:220)

at
org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:58)

at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:626)

... 5 more

3 Replies Last Post 29 set 2012, 14:09 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12 mar 2011, 09:05 GMT-5
Using random model tags solved this issue.
Using random model tags solved this issue.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 giu 2012, 12:35 GMT-4
I have also received the same error messages (in Comsol 4.2a) when trying to access the mesh information of a model already in the workspace. Any fixes for this?
I would use
mesh = mpxmeshinfo(model); and the link would crash

It is not always this command, but this is the most common
I have also received the same error messages (in Comsol 4.2a) when trying to access the mesh information of a model already in the workspace. Any fixes for this? I would use mesh = mpxmeshinfo(model); and the link would crash It is not always this command, but this is the most common

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 set 2012, 14:09 GMT-4
Could you explain that point ?
Thank you in advance.

--
L. Queval
Could you explain that point ? Thank you in advance. -- L. Queval

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.