COMSOL - M-file with unnecessary entries

  • Thread starter Thread starter DJ_GoodNews
  • Start date Start date
  • Tags Tags
    Comsol
AI Thread Summary
The discussion revolves around issues with COMSOL-generated M-files that contain excessive and outdated entries, making them difficult to manage. Users have noted that while the "reset model" option is intended to streamline the M-file by retaining only relevant commands, it does not fully eliminate all historical entries. One participant shared insights from COMSOL support, indicating that the reset function does not clear the complete command history. The conversation also touches on how users typically handle scripting, with some opting to start from scratch or convert MPH files to M-files. Suggestions include using text editors with syntax highlighting and scripting languages like Python or Perl to automate M-file generation, reducing the need for repetitive tasks. Overall, the thread highlights the challenges of managing M-files in COMSOL and explores various strategies for improving workflow.
DJ_GoodNews
Messages
5
Reaction score
0
Hello everybody!

I have the problem that my comsol generated m-files contain a lot of repeating entries and old values which have been changed in the process of creating the *.mph-file.

Comsol writes in the knowledge base:
"When saving a model as an M-file it contains by default all the command history. This makes the file dense and not easy to work with. Using the reset option under the file menu makes the script clear as it only keeps the commands that correspond to the current model."

I am already doing it like this, I am using the reset model option, but still the m-file is unstructured because of unnecessary entries.

How can one get rid of these? Thanks!


DJ_Goodnews.
 
Physics news on Phys.org
Hi,

(..."Using the reset option under the file menu makes the script clear as it only keeps the commands that correspond to the current model." ..)

I got an message from the Comsol support. They state, that the "reset option" does not clear the complete history.

Since I got no answers so far, Iwoulde be interested if anyone has the same problem?

And how people in general you work with the skript.
-Do you start from scratch? Or convert a mph. to an m-file ? ...
-Any suggestions, how to get along with the script?

Cheers,
DJ_GoodNews
 
Yeah, the reset is what it is in terms of cleaning the m - file. Haven't come up with any other way than to mix text editors with highlighting and scripting to script m - files (i.e. generate m - files using python/perl so don't have to repeat everything every time or resort to too much copy - pasting). So essentially from scratch.
 

Similar threads

Replies
3
Views
23K
Replies
1
Views
10K
Replies
4
Views
4K
Replies
3
Views
2K
Replies
6
Views
6K
Replies
2
Views
2K
Replies
11
Views
27K
Back
Top