Hello COMSOL aficianados,
We are working with the Java API for COMSOL here. Let's say you want to load the material copper into your model. It seems, according to the manual, that the only way to get all the material properties is to define them all yourself using e.g.:
myModel.material().create("mat1");
myModel.material("mat1").name("Material name");
myModel.material("mat1").set("roughness",0.1);
myModel.material("mat1").set("shininess",200);
myModel.material("mat1").propertyGroup("def").set("density","8700[kg/m^3]");
etc. ad nauseum for every single material property.
My question - is there a way to just do, using the API, what I would do in the GUI, which is to load the pre-defined material from the COMSOL materials library? Something like:
myModel.material().loadFromLibrary("copper")
and that would automatically just load up everything into the model?
Link to COMSOL 4.2 Java API manual:
nf.nci.org.au/facilities/softw...OMSOLJavaAPIReferenceGuide.pdf
We are working with the Java API for COMSOL here. Let's say you want to load the material copper into your model. It seems, according to the manual, that the only way to get all the material properties is to define them all yourself using e.g.:
myModel.material().create("mat1");
myModel.material("mat1").name("Material name");
myModel.material("mat1").set("roughness",0.1);
myModel.material("mat1").set("shininess",200);
myModel.material("mat1").propertyGroup("def").set("density","8700[kg/m^3]");
etc. ad nauseum for every single material property.
My question - is there a way to just do, using the API, what I would do in the GUI, which is to load the pre-defined material from the COMSOL materials library? Something like:
myModel.material().loadFromLibrary("copper")
and that would automatically just load up everything into the model?
Link to COMSOL 4.2 Java API manual:
nf.nci.org.au/facilities/softw...OMSOLJavaAPIReferenceGuide.pdf