Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
a15d0f8a
Commit
a15d0f8a
authored
16 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
output banner cosmetics
- move url to lower right: makes version information stand out better
parent
b5f06a38
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/foamUpdateCaseFileHeader
+14
-11
14 additions, 11 deletions
bin/foamUpdateCaseFileHeader
src/OpenFOAM/db/IOobject/IOobjectI.H
+2
-2
2 additions, 2 deletions
src/OpenFOAM/db/IOobject/IOobjectI.H
with
16 additions
and
13 deletions
bin/foamUpdateCaseFileHeader
+
14
−
11
View file @
a15d0f8a
...
@@ -45,8 +45,8 @@ options:
...
@@ -45,8 +45,8 @@ options:
-h help
-h help
Updates the header of application files and removes consecutive blank lines.
Updates the header of application files and removes consecutive blank lines.
By default, writes current version in the header.
By default, writes current
OpenFOAM
version in the header.
An alternative version can be specified with -v option.
An alternative version can be specified with
the
-v option.
USAGE
USAGE
exit
1
exit
1
...
@@ -59,8 +59,8 @@ printHeader() {
...
@@ -59,8 +59,8 @@ printHeader() {
| ========= | |
| ========= | |
|
\\\\
/ F ield | OpenFOAM: The Open Source CFD Toolbox |
|
\\\\
/ F ield | OpenFOAM: The Open Source CFD Toolbox |
|
\\\\
/ O peration | Version:
${
foamVersion
}
|
|
\\\\
/ O peration | Version:
${
foamVersion
}
|
|
\\\\
/ A nd |
Web:
http://www.OpenFOAM.org
|
|
\\\\
/ A nd |
|
|
\\\\
/ M anipulation |
|
|
\\\\
/ M anipulation |
www.OpenFOAM.org
|
\\
*---------------------------------------------------------------------------*/
\\
*---------------------------------------------------------------------------*/
FoamFile
FoamFile
{
{
...
@@ -84,13 +84,13 @@ FoamFileAttribute() {
...
@@ -84,13 +84,13 @@ FoamFileAttribute() {
#
#
# OPTIONS
# OPTIONS
#
#
OPTS
=
`
getopt hv:
$*
`
opts
=
$(
getopt hv:
$*
)
if
[
$?
-ne
0
]
if
[
$?
-ne
0
]
then
then
echo
"Aborting due to invalid option"
echo
"Aborting due to invalid option"
usage
usage
fi
fi
eval set
--
'$
OPTS
'
eval set
--
'$
opts
'
while
[
"
$1
"
!=
"--"
]
while
[
"
$1
"
!=
"--"
]
do
do
case
$1
in
case
$1
in
...
@@ -110,11 +110,13 @@ shift
...
@@ -110,11 +110,13 @@ shift
# constant width for version
# constant width for version
foamVersion
=
`
printf
%-36s
$foamVersion
`
foamVersion
=
$(
printf
%-36s
$foamVersion
)
#
#
# MAIN
# MAIN
#
#
unset
NOTE
for
caseFile
for
caseFile
do
do
if
grep
FoamFile
$caseFile
>
/dev/null 2>&1
if
grep
FoamFile
$caseFile
>
/dev/null 2>&1
...
@@ -122,16 +124,17 @@ do
...
@@ -122,16 +124,17 @@ do
echo
"Updating case file:
$caseFile
"
echo
"Updating case file:
$caseFile
"
sed
-n
'/FoamFile/,/}/p'
$caseFile
>
FoamFile.tmp
sed
-n
'/FoamFile/,/}/p'
$caseFile
>
FoamFile.tmp
CLASS
=
`
FoamFileAttribute class FoamFile.tmp
`
FORMAT
=
$(
FoamFileAttribute format FoamFile.tmp
)
OBJECT
=
`
FoamFileAttribute object FoamFile.tmp
`
CLASS
=
$(
FoamFileAttribute class FoamFile.tmp
)
FORMAT
=
`
FoamFileAttribute format FoamFile.tmp
`
OBJECT
=
$(
FoamFileAttribute object FoamFile.tmp
)
# extract NOTE?
printHeader
$FORMAT
$CLASS
$OBJECT
$NOTE
>
FoamFile.tmp
printHeader
$FORMAT
$CLASS
$OBJECT
$NOTE
>
FoamFile.tmp
sed
'1,/}/d'
$caseFile
|
sed
'/./,/^$/!d'
>>
FoamFile.tmp
sed
'1,/}/d'
$caseFile
|
sed
'/./,/^$/!d'
>>
FoamFile.tmp
# use cat to avoid removing/replace soft-links
# use cat to avoid removing/replace soft-links
[
-s
FoamFile.tmp
]
&&
cat
FoamFile.tmp
>
|
$caseFile
[
-s
FoamFile.tmp
]
&&
cat
FoamFile.tmp
>
|
$caseFile
rm
FoamFile.tmp
rm
-f
FoamFile.tmp
2>/dev/null
else
else
echo
" Invalid case file:
$caseFile
"
1>&2
echo
" Invalid case file:
$caseFile
"
1>&2
fi
fi
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/IOobject/IOobjectI.H
+
2
−
2
View file @
a15d0f8a
...
@@ -65,8 +65,8 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
...
@@ -65,8 +65,8 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
"| ========= | |
\n
"
"| ========= | |
\n
"
"|
\\\\
/ F ield | OpenFOAM: The Open Source CFD Toolbox |
\n
"
"|
\\\\
/ F ield | OpenFOAM: The Open Source CFD Toolbox |
\n
"
"|
\\\\
/ O peration | Version: "
<<
FOAMversion
<<
spaces
<<
"|
\n
"
"|
\\\\
/ O peration | Version: "
<<
FOAMversion
<<
spaces
<<
"|
\n
"
"|
\\\\
/ A nd |
Web:
http://www.OpenFOAM.org
|
\n
"
"|
\\\\
/ A nd |
|
\n
"
"|
\\\\
/ M anipulation |
|
\n
"
"|
\\\\
/ M anipulation |
www.OpenFOAM.org
|
\n
"
"
\\
*---------------------------------------------------------------------------*/
\n
"
;
"
\\
*---------------------------------------------------------------------------*/
\n
"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment