CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Java with CCM+

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 4, 2013, 10:57
Default
  #7
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by crevoise View Post
I wrote the following:
Code:
import passivescalar.*;
.. 
PassiveScalarMaterial passiv=
physics.getModelManager().getModel(PassiveScalarModel.class)
.getPassiveScalarManager().getPassiveScalarMaterials();
Which returns:
incompatible type:
found: java.util.Collection<star.passivescalar.PassiveSca larMaterial>
required: star.passivesscalar.PassiveScalarMaterial
Like the error message states, you are trying to assign things incorrectly. It's not much different than trying to assign a String to a double, for example.

If you try with the proper assignment, I'm convinced you can resolve the error:
Code:
 
Collection<PassiveScalarMaterial> matlLst = physics.getModelManager().getModel(PassiveScalarModel.class)
.getPassiveScalarManager().getPassiveScalarMaterials();
You can then go on and do other useful things with this collection of materials. You can, of course, just get a single material by name too. That is what the "getPassiveScalarMaterial(String name)" method seems to provide.
olesen is offline   Reply With Quote

 

Tags
ccm+, java


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem when imported geometry from 3D CAD to star ccm, TAREK GANAT STAR-CCM+ 1 May 21, 2013 22:15
Macro to access java files in sub-directory abraum STAR-CCM+ 3 July 11, 2012 02:46
Fluent Vs Star CCM firda Main CFD Forum 3 February 26, 2011 02:51
error in star ccm maurizio Siemens 3 October 16, 2007 05:17
Getting OpenFOAM to coexist with an existing JAVA VM nik777 OpenFOAM Installation 5 February 22, 2007 07:21


All times are GMT -4. The time now is 13:52.