CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   extracting the subtitle (https://www.cfd-online.com/Forums/siemens/52690-extracting-subtitle.html)

Joern Beilke September 21, 2001 13:52

extracting the subtitle
 
Is there a way to extract the subtitle from an existing case using a script? Usually cdsave can be used to get information about most settings in the .mdl file, but the subtitle is not saved there.

Next problem: is there a command to list all existing plla's with the contents, position, ...

steve September 24, 2001 08:45

Re: extracting the subtitle
 
If you do a "status" while in the plot module, it will list all plla's with complete information. I don't think there is anyway to extract the subtitle.

Jon September 24, 2001 09:12

Re: extracting the subtitle
 
Is this rhyming-slang?

stefan September 25, 2001 07:57

Re: extracting the subtitle
 
You say that you use the cdsave command to get the model title. I assume that you open the generated .inp file and read the title from there. You could do something similar with a plot file or a postscript file generated out of it. Make a plot with at least the title and subtitle on it. As they are normally located at the same position, you can easily find out the location where the subtitle is generated in the plot or postscript file and then read it from there.

Joern Beilke September 25, 2001 08:09

Re: extracting the subtitle
 
I already did it :)

Here is the perl script to extract title and subtitle from the plot file:



#!/usr/bin/perl
################################################## ####################
# (c) Joern Beilke , 2001
################################################## ####################

if (!defined $ARGV[0]) {
print "USAGE : subtitle.pl casename\n";
exit;
}

my $casename = $ARGV[0];

open(IN , "<${casename}.plot") || die "Datei '${casename}.plot' ist nicht vorhanden";
@alles = <IN>;
$text = join("",@alles);
$text =~ s/\n//g;

while ($text =~ /.*2,0.15,0.7,5,1,([\d]+),(.{120}).*/g) {
$i = $1;
$title = substr($2,0,$i);
print "TITLE: $title\n";
}

while ($text =~ /.*2,0.15,0.45,5,1,([\d]+),(.{120}).*/g) {
$i = $1;
$title = substr($2,0,$i);
print "SUBTITLE1: $title\n";
}

while ($text =~ /.*2,0.15,0.2,5,1,([\d]+),(.{120}).*/g) {
$i = $1;
$title = substr($2,0,$i);
print "SUBTITLE2: $title\n";
}

Joern Beilke October 8, 2001 11:40

Re: extracting the subtitle
 
The line

@alles = ; must be changed to

@alles = <IN>;

The correct version was posted but one has to look at the html-source to get it. The "<IN>" was interpreted as a html-command.

Joern Beilke October 8, 2001 12:17

Re: extracting the subtitle
 
Even when I put in the correct html command to create the "less than" sign, it does not work correctly.

So please look at the "page source" to get the correct version.


All times are GMT -4. The time now is 05:03.