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.
Comsol Java Geometry Get Faces with Coordinates or equivalent of mphgetCoords() in COMSOL Java API
Posted 2017年5月22日 GMT-4 13:52 Interfacing Version 5.2 0 Replies
Please login with a confirmed email address before reporting spam
----------------------------------
EDIT:
ok, I found mphgetCoords(model,'geom1','domain',7) apparently is designed to get the coordinates for the 7th domain in geometry geom1. This is from the Livelink with Matlab.
Anyone know what is the equivalent function of mphgetCoords in COMSOL Java API?
----------------------------------
I am new to the Comsol Java API. If I want to run an FEA simulation, part of it requires me to select the boundaries for the simulation:
model.physics("ht").feature().create("hf1", "HeatFluxBoundary", 2);
model.physics("ht").feature("hf1").selection().all();
model.physics("ht").feature("hf1").selection()
.set(new int[]{1, 2, 3, 5, 6, 7, 73, 74, 75, 76, 77, 91, 92, 93, 94, 95, 96, 97, 98});
These numbers in the selection are all face numbers (The geometry has 98 faces).
My question is: how can i get the coordinates of every face with the java api (to label in my custom geometry viewer)?
I looked at the following but I am having trouble interpreting this:
System.out.println("Faces " + model.geom("geom1").getNFaces()); ---------> Faces 98
GeomSequence gs = model.geom("geom1").geomRep("comsol");
gs.run();
System.out.println(gs.getFace().length);
double[][] faces = gs.getFace(); ------> returns 4 x 98
are any of those co-ordinates? Is there anyway to get co-ordinates associated with face numbers to highlight in model in my custom viewer?
Many Thanks,
Anil
Hello Anil Sehgal
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.