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.

LiveLink and Mesh Refinement

Please login with a confirmed email address before reporting spam

I probably just don't know what I am doing, since I didn't ever use COMSOL until last week. Anyway, I have a model that I would like to refine the mesh. However, I can't seem to get this to work. Using
mphmesh(model,'mesh1')
plots my mesh like expected, but
mesh1.feature.create('ref1','Refine');
??? Undefined variable "mesh1" or class "mesh1.feature.create".

What is the deal?

EDIT: I am using COMSOL 4.1 and MatLab 2011a

EDIT: I get the following error when trying to create the mesh (I figured maybe it didn't actually create the struc)

mesh1=model.mesh.create('mesh1','geom1')
??? Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: An object with the given
name already exists
Messages:
An object with the given name already exists
- Name: mesh1

Stack trace:
at com.comsol.model.impl.ModelEntityListImpl.i(Unknown Source)
at com.comsol.model.impl.MeshListImpl.a(Unknown Source)
at com.comsol.model.impl.MeshListImpl$b.a(Unknown Source)
at com.comsol.model.impl.MeshListImpl$b.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown
Source)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

1 Reply Last Post 8 août 2011, 13:32 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 août 2011, 13:32 UTC−4
I had a syntax error. To refine a mesh do the following

model.mesh('mesh1').feature.create('ref1','Refine');
model.mesh('mesh1').run;
I had a syntax error. To refine a mesh do the following model.mesh('mesh1').feature.create('ref1','Refine'); model.mesh('mesh1').run;

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.