Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlaSim
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lunkeit, Frank
PlaSim
Commits
99f4bf48
Commit
99f4bf48
authored
8 years ago
by
Edilbert Kirk
Browse files
Options
Downloads
Patches
Plain Diff
add amplitude plot
parent
b5bb956f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cat/src/guix11.c
+80
-16
80 additions, 16 deletions
cat/src/guix11.c
cat/src/pumax.c
+0
-4763
0 additions, 4763 deletions
cat/src/pumax.c
cat/src/pumax_stub.c
+0
-45
0 additions, 45 deletions
cat/src/pumax_stub.c
with
80 additions
and
4824 deletions
cat/src/guix11.c
+
80
−
16
View file @
99f4bf48
...
...
@@ -83,6 +83,7 @@ int Debug = 0; // set in initgui
#define MAPHOR 11
#define MAPTRA 12
#define LINE 13
#define ISOAMP 14
/* Models */
...
...
@@ -104,7 +105,8 @@ char *IsoNames[] =
"ISOROT"
,
"MAPHOR"
,
"MAPTRA"
,
"LINE"
"LINE"
,
"ISOAMP"
};
int
IsoTypes
=
sizeof
(
IsoNames
)
/
sizeof
(
char
*
);
...
...
@@ -302,12 +304,14 @@ double AutoXdelt[NUMWIN];
double
AutoLo
[
NUMWIN
];
double
LineScale
[
NUMWIN
];
// last used scale for LINE plots
double
LineMin
[
NUMWIN
];
// last used offset for LINE plots
REAL
*
Amp
[
NUMWIN
];
// amplitudes of an array
REAL
*
TSdata
[
NUMWIN
];
REAL
*
Dmin
[
NUMWIN
];
REAL
*
Dmax
[
NUMWIN
];
REAL
*
SpeedScale
;
XPoint
*
TSxp
[
NUMWIN
];
// data for timeseries
XPoint
*
LIxp
[
NUMWIN
];
// data for line plots
XColor
*
Aco
[
NUMWIN
];
// colors for amplitude plots
#define MAXPAR 16384
float
pax
[
MAXPAR
];
...
...
@@ -631,8 +635,6 @@ REAL VGAY;
REAL
CurVal
;
REAL
*
Field
;
// Pointer for ISO data
REAL
*
Ampli
;
// Amplitudes of spherical harmonics
XColor
*
Acol
;
// Amplitude colors
Colormap
colormap
;
...
...
@@ -3042,10 +3044,10 @@ void TracerPlot(int w)
/* ============= */
/* Amplitude
Plot
*/
/*
SH_
Amplitude
s
*/
/* ============= */
void
Amplitude
Plot
(
void
)
void
SH_
Amplitude
s
(
int
w
)
{
int
i
,
j
,
m
,
n
;
int
x
,
y
;
...
...
@@ -3054,18 +3056,18 @@ void AmplitudePlot(void)
int
imax
;
REAL
Amax
,
Fac
;
if
(
!
Amp
li
)
Amp
li
=
FloatAlloc
(
DimX
,
"Amp
li
"
);
if
(
!
Aco
l
)
Aco
l
=
SizeAlloc
(
DimX
,
sizeof
(
XColor
),
"Aco
l
"
);
if
(
!
Amp
[
w
]
)
Amp
[
w
]
=
FloatAlloc
(
DimX
,
"Amp
[w]
"
);
if
(
!
Aco
[
w
]
)
Aco
[
w
]
=
SizeAlloc
(
DimX
,
sizeof
(
XColor
),
"Aco
[w]
"
);
Amax
=
0
.
0
;
imax
=
0
;
for
(
i
=
0
;
i
<
DimX
;
++
i
)
{
Amp
li
[
i
]
=
log
(
1
.
0
+
sqrt
(
Field
[
2
*
i
]
*
Field
[
2
*
i
]
+
Field
[
2
*
i
+
1
]
*
Field
[
2
*
i
+
1
]));
Aco
l
[
i
].
pixel
=
WhitePix
;
if
(
Amp
li
[
i
]
>
Amax
&&
i
>
DimY
)
Amp
[
w
]
[
i
]
=
log
(
1
.
0
+
sqrt
(
Field
[
2
*
i
]
*
Field
[
2
*
i
]
+
Field
[
2
*
i
+
1
]
*
Field
[
2
*
i
+
1
]));
Aco
[
w
]
[
i
].
pixel
=
WhitePix
;
if
(
Amp
[
w
]
[
i
]
>
Amax
&&
i
>
DimY
)
{
Amax
=
Amp
li
[
i
];
Amax
=
Amp
[
w
]
[
i
];
imax
=
i
;
}
}
...
...
@@ -3074,9 +3076,9 @@ void AmplitudePlot(void)
if
(
Amax
>
1.e-20
)
Fac
=
1
.
0
/
Amax
;
for
(
i
=
0
;
i
<
DimX
;
++
i
)
{
j
=
AMPLI_COLS
*
Amp
li
[
i
]
*
Fac
;
j
=
AMPLI_COLS
*
Amp
[
w
]
[
i
]
*
Fac
;
if
(
j
>=
AMPLI_COLS
)
j
=
AMPLI_COLS
-
1
;
Aco
l
[
i
].
pixel
=
AmpliStrip
[
j
].
pixel
;
Aco
[
w
]
[
i
].
pixel
=
AmpliStrip
[
j
].
pixel
;
}
dx
=
WinXSize
/
23
;
...
...
@@ -3090,7 +3092,61 @@ void AmplitudePlot(void)
if
(
n
<
22
)
{
x
=
dx
/
2
+
n
*
dx
;
XSetForeground
(
display
,
gc
,
Acol
[
i
].
pixel
);
XSetForeground
(
display
,
gc
,
Aco
[
w
][
i
].
pixel
);
XFillArc
(
display
,
pix
,
gc
,
x
,
y
,
r
,
r
,
0
,
360
*
64
);
}
}
}
/* ========== */
/* Amplitudes */
/* ========== */
void
Amplitudes
(
int
w
)
{
int
i
,
j
,
m
,
n
;
int
x
,
y
;
int
r
,
dx
,
dy
;
int
imax
;
REAL
Amax
,
Fac
;
if
(
!
Amp
[
w
])
Amp
[
w
]
=
FloatAlloc
(
DimXY
,
"Amp[w]"
);
if
(
!
Aco
[
w
])
Aco
[
w
]
=
SizeAlloc
(
DimXY
,
sizeof
(
XColor
),
"Aco[w]"
);
Amax
=
0
.
0
;
imax
=
0
;
for
(
i
=
0
;
i
<
DimXY
;
++
i
)
{
Amp
[
w
][
i
]
=
log
(
1
.
0
+
sqrt
(
Field
[
2
*
i
]
*
Field
[
2
*
i
]
+
Field
[
2
*
i
+
1
]
*
Field
[
2
*
i
+
1
]));
Aco
[
w
][
i
].
pixel
=
WhitePix
;
if
(
Amp
[
w
][
i
]
>
Amax
)
{
Amax
=
Amp
[
w
][
i
];
imax
=
i
;
}
}
Fac
=
0
.
0
;
if
(
Amax
>
1.e-20
)
Fac
=
1
.
0
/
Amax
;
for
(
i
=
0
;
i
<
DimXY
;
++
i
)
{
j
=
AMPLI_COLS
*
Amp
[
w
][
i
]
*
Fac
;
if
(
j
>=
AMPLI_COLS
)
j
=
AMPLI_COLS
-
1
;
Aco
[
w
][
i
].
pixel
=
AmpliStrip
[
j
].
pixel
;
}
dx
=
WinXSize
/
(
DimX
+
1
);
dy
=
WinYSize
/
(
DimY
+
1
);
r
=
(
dx
+
dx
+
dy
+
dy
)
/
6
;
XSetForeground
(
display
,
gc
,
BlackPix
);
for
(
m
=
0
,
i
=
0
;
m
<
DimX
;
++
m
)
{
y
=
FixFontHeight
+
4
+
m
*
dx
;
for
(
n
=
0
;
n
<
DimY
;
++
n
)
{
x
=
dx
/
2
+
n
*
dx
;
XSetForeground
(
display
,
gc
,
Aco
[
w
][
i
++
].
pixel
);
XFillArc
(
display
,
pix
,
gc
,
x
,
y
,
r
,
r
,
0
,
360
*
64
);
}
}
...
...
@@ -4334,7 +4390,8 @@ void iso(int w,int PicType,REAL *field,int dimx,int dimy,int dimz,int pal)
FlagSize
=
DimX
;
}
if
(
PicType
==
ISOSH
)
pal
=
1
;
// ISOSH has its own palette
if
(
PicType
==
ISOSH
||
PicType
==
ISOAMP
)
pal
=
1
;
// special palette
if
(
pal
<
1
||
pal
>=
NUMPAL
)
{
Cstrip
=
Autostrip
;
...
...
@@ -4714,7 +4771,14 @@ void iso(int w,int PicType,REAL *field,int dimx,int dimy,int dimz,int pal)
if
(
PicType
==
ISOSH
)
{
AmplitudePlot
();
SH_Amplitudes
(
w
);
}
// amplitudes of rectangular array
if
(
PicType
==
ISOAMP
)
{
Amplitudes
(
w
);
}
// line plot
...
...
This diff is collapsed.
Click to expand it.
cat/src/pumax.c
deleted
100644 → 0
+
0
−
4763
View file @
b5bb956f
This diff is collapsed.
Click to expand it.
cat/src/pumax_stub.c
deleted
100644 → 0
+
0
−
45
View file @
b5bb956f
#include
<sys/resource.h>
void
pumax_dummy
(
void
)
{}
int
nresources_
(
double
*
ut
,
double
*
st
,
long
*
mem
,
long
*
par
,
long
*
paf
,
long
*
swa
,
long
*
dr
,
long
*
dw
)
{
struct
rusage
ru
;
getrusage
(
RUSAGE_SELF
,
&
ru
);
*
ut
=
ru
.
ru_utime
.
tv_sec
+
0
.
000001
*
ru
.
ru_utime
.
tv_usec
;
*
st
=
ru
.
ru_stime
.
tv_sec
+
0
.
000001
*
ru
.
ru_stime
.
tv_usec
;
*
mem
=
ru
.
ru_maxrss
;
*
par
=
ru
.
ru_minflt
;
*
paf
=
ru
.
ru_majflt
;
*
swa
=
ru
.
ru_nswap
;
*
dr
=
ru
.
ru_inblock
;
*
dw
=
ru
.
ru_oublock
;
return
1
;
}
/* ------------------------------------------------ */
/* Stub routines for Absoft Compiler and others, */
/* which require, that FORTRAN callable C-functions */
/* are written in uppercase letters only */
/* ------------------------------------------------ */
int
NRESOURCES
(
double
*
ut
,
double
*
st
,
long
*
mem
,
long
*
par
,
long
*
paf
,
long
*
swa
,
long
*
dr
,
long
*
dw
)
{
return
nresources_
(
ut
,
st
,
mem
,
par
,
paf
,
swa
,
dr
,
dw
);
}
/* ------------------------------------------------ */
/* Stub routines for IBM Compiler and others, */
/* which require, that FORTRAN callable C-functions */
/* are written in lowercase without underscore */
/* ------------------------------------------------ */
int
nresources
(
double
*
ut
,
double
*
st
,
long
*
mem
,
long
*
par
,
long
*
paf
,
long
*
swa
,
long
*
dr
,
long
*
dw
)
{
return
nresources_
(
ut
,
st
,
mem
,
par
,
paf
,
swa
,
dr
,
dw
);
}
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