generate_model_java
Generate a standalone COMSOL Java model source file that can be prepared without COMSOL installed, then compiled and run on a COMSOL machine.
Instructions
Generate a standalone, compilable COMSOL Java model source file.
Works WITHOUT COMSOL installed. Use it on a COMSOL-less machine to prepare a
Java model, then move the file to a COMSOL machine and compile it:
comsolcompile .java
comsolbatch -java
spec may carry geometries/physics/materials/studies/save to shape the code.
The produced file still needs COMSOL to actually compile into a .mph.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filepath": "<filepath>"
},
"name": "generate_model_java"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | No | ||
| filepath | Yes | ||
| class_name | No | GeneratedModel | |
| model_version | No | 6.2 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |