COMSOL - M-file with unnecessary entries

  • Thread starter Thread starter DJ_GoodNews
  • Start date Start date
  • Tags Tags
    Comsol
Click For Summary
SUMMARY

The forum discussion centers on the challenges faced by users of COMSOL when generating M-files that contain excessive and outdated entries. Users have noted that while the "reset option" under the file menu is intended to streamline the M-file by retaining only relevant commands, it does not eliminate all historical entries. COMSOL support has confirmed this limitation. To manage the clutter, some users resort to using external scripting tools like Python or Perl to generate cleaner M-files from scratch, avoiding repetitive tasks.

PREREQUISITES
  • Familiarity with COMSOL Multiphysics software
  • Understanding of M-file scripting
  • Basic knowledge of Python or Perl for scripting
  • Experience with text editing tools for code management
NEXT STEPS
  • Explore advanced M-file scripting techniques in COMSOL
  • Learn how to integrate Python with COMSOL for M-file generation
  • Research best practices for managing command history in COMSOL
  • Investigate text editors that enhance M-file readability and editing
USEFUL FOR

This discussion is beneficial for COMSOL users, engineers, and researchers who are looking to optimize their M-file generation process and streamline their workflow in COMSOL Multiphysics.

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 ·
Replies
3
Views
23K
  • · Replies 1 ·
Replies
1
Views
10K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K