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.

Names not consistent with number of parameter lists

Prakyath Pindi Nataraj

Please login with a confirmed email address before reporting spam

I am trying to create a parametric sweep in the application builder. The aforementioned error appears as a consequence of the following line of code:

*model.sol("sol1").feature("s1").feature("p1").set("plistarr", temp); *

temp is a String[] variable that I have defined. The following line of code however seems work:

model.sol("sol1").feature("s1").feature("p1")..set("plistarr", new String[]{"30000 60000 90000 120000 150000 180000 210000 240000 270000 300000"});

In this regard, I tried to define temp as shown below, but I get an indication stating that "Array constants can only be used in initializers".

temp={"30000 60000 90000 120000 150000 180000 210000 240000 270000 300000"};

I have no experience in working with java and hence, I would appreciate it if someone could help me resolve this error.


0 Replies Last Post 9 mar 2021, 05:05 GMT-5
COMSOL Moderator

Hello Prakyath Pindi Nataraj

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.

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.