Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
multiscale
lammps
Commits
a5497527
Commit
a5497527
authored
6 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
reduce compiler warnings and some more whitespace adjustments
parent
590ab166
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/USER-MISC/compute_pressure_cylinder.cpp
+15
-20
15 additions, 20 deletions
src/USER-MISC/compute_pressure_cylinder.cpp
with
15 additions
and
20 deletions
src/USER-MISC/compute_pressure_cylinder.cpp
+
15
−
20
View file @
a5497527
...
@@ -50,10 +50,10 @@ static const char cite_compute_pressure_cylinder[] =
...
@@ -50,10 +50,10 @@ static const char cite_compute_pressure_cylinder[] =
ComputePressureCyl
::
ComputePressureCyl
(
LAMMPS
*
lmp
,
int
narg
,
char
**
arg
)
:
ComputePressureCyl
::
ComputePressureCyl
(
LAMMPS
*
lmp
,
int
narg
,
char
**
arg
)
:
Compute
(
lmp
,
narg
,
arg
),
Compute
(
lmp
,
narg
,
arg
),
R
(
NULL
),
Rinv
(
NULL
),
R2
(
NULL
),
R2kin
(
NULL
),
invVbin
(
NULL
),
Pr_temp
(
NULL
),
Pr_all
(
NULL
),
Pz_temp
(
NULL
),
Pz_all
(
NULL
),
Pphi_temp
(
NULL
),
density_temp
(
NULL
),
density_all
(
NULL
),
tangent
(
NULL
),
ephi_x
(
NULL
),
Pphi_all
(
NULL
),
R
(
NULL
),
Rinv
(
NULL
),
R2
(
NULL
),
PrAinv
(
NULL
),
PzAinv
(
NULL
),
ephi_y
(
NULL
),
Pr
_temp
(
NULL
),
Pr_all
(
NULL
),
Pz_temp
(
NULL
),
Pz
_all
(
NULL
),
R2kin
(
NULL
),
density
_temp
(
NULL
),
invVbin
(
NULL
),
density
_all
(
NULL
),
Pphi_temp
(
NULL
),
P
phi_
all
(
NULL
),
PrAinv
(
NULL
),
PzAinv
(
NULL
),
binz
(
NULL
)
tangent
(
NULL
),
e
phi_
x
(
NULL
),
ephi_y
(
NULL
),
binz
(
NULL
)
{
{
if
(
lmp
->
citeme
)
lmp
->
citeme
->
add
(
cite_compute_pressure_cylinder
);
if
(
lmp
->
citeme
)
lmp
->
citeme
->
add
(
cite_compute_pressure_cylinder
);
if
(
narg
!=
7
)
error
->
all
(
FLERR
,
"Illegal compute pressure/cylinder command"
);
if
(
narg
!=
7
)
error
->
all
(
FLERR
,
"Illegal compute pressure/cylinder command"
);
...
@@ -171,7 +171,7 @@ void ComputePressureCyl::init()
...
@@ -171,7 +171,7 @@ void ComputePressureCyl::init()
invVbin
[
0
]
=
1.0
/
((
zhi
-
zlo
)
*
MY_PI
*
R2kin
[
0
]);
invVbin
[
0
]
=
1.0
/
((
zhi
-
zlo
)
*
MY_PI
*
R2kin
[
0
]);
PzAinv
[
0
]
=
1.0
/
(
MY_PI
*
R2kin
[
0
]
*
((
double
)
nzbins
));
PzAinv
[
0
]
=
1.0
/
(
MY_PI
*
R2kin
[
0
]
*
((
double
)
nzbins
));
for
(
int
jq
=
1
;
jq
<
nbins
;
jq
++
)
{
for
(
int
jq
=
1
;
jq
<
nbins
;
jq
++
)
{
invVbin
[
jq
]
=
1.0
/
((
zhi
-
zlo
)
*
MY_PI
*
(
R2kin
[
jq
]
-
R2kin
[
jq
-
1
]));
invVbin
[
jq
]
=
1.0
/
((
zhi
-
zlo
)
*
MY_PI
*
(
R2kin
[
jq
]
-
R2kin
[
jq
-
1
]));
PzAinv
[
jq
]
=
1.0
/
(
MY_PI
*
(
R2kin
[
jq
]
-
R2kin
[
jq
-
1
])
*
((
double
)
nzbins
));
PzAinv
[
jq
]
=
1.0
/
(
MY_PI
*
(
R2kin
[
jq
]
-
R2kin
[
jq
-
1
])
*
((
double
)
nzbins
));
...
@@ -189,7 +189,7 @@ void ComputePressureCyl::init()
...
@@ -189,7 +189,7 @@ void ComputePressureCyl::init()
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void
ComputePressureCyl
::
init_list
(
int
id
,
NeighList
*
ptr
)
void
ComputePressureCyl
::
init_list
(
int
/* id */
,
NeighList
*
ptr
)
{
{
list
=
ptr
;
list
=
ptr
;
}
}
...
@@ -226,10 +226,10 @@ void ComputePressureCyl::compute_array()
...
@@ -226,10 +226,10 @@ void ComputePressureCyl::compute_array()
int
me
;
int
me
;
MPI_Comm_rank
(
world
,
&
me
);
MPI_Comm_rank
(
world
,
&
me
);
int
i
,
j
,
n
,
ii
,
jj
,
inum
,
jnum
,
itype
,
jtype
;
int
i
,
j
,
ii
,
jj
,
inum
,
jnum
,
itype
,
jtype
;
tagint
itag
,
jtag
;
tagint
itag
,
jtag
;
double
xtmp
,
ytmp
,
ztmp
,
delx
,
dely
,
delz
;
double
xtmp
,
ytmp
,
ztmp
,
delx
,
dely
,
delz
;
double
rsq
,
eng
,
fpair
,
factor_coul
,
factor_lj
;
double
rsq
,
fpair
,
factor_coul
,
factor_lj
;
int
*
ilist
,
*
jlist
,
*
numneigh
,
**
firstneigh
;
int
*
ilist
,
*
jlist
,
*
numneigh
,
**
firstneigh
;
double
**
x
=
atom
->
x
;
double
**
x
=
atom
->
x
;
...
@@ -276,14 +276,12 @@ void ComputePressureCyl::compute_array()
...
@@ -276,14 +276,12 @@ void ComputePressureCyl::compute_array()
double
r1
=
0.0
;
double
r1
=
0.0
;
double
r2
=
0.0
;
double
r2
=
0.0
;
double
risq
,
rjsq
;
double
risq
,
rjsq
;
double
ri
,
rj
,
rij
,
fij
;
double
A
,
B
,
C
,
D
;
double
A
,
B
,
C
,
Bsq
,
A2inv
,
A4
,
D
;
double
alpha1
,
alpha2
;
double
alpha1
,
alpha2
,
aij
;
double
xi
,
yi
,
zi
,
dx
,
dy
,
dz
;
double
xi
,
yi
,
zi
,
dx
,
dy
,
dz
;
double
m
,
xR
,
yR
,
zR
,
fn
;
double
xR
,
yR
,
zR
,
fn
;
double
alpha
,
xL
,
yL
,
zL
,
L2
,
ftphi
,
ftz
;
double
alpha
,
xL
,
yL
,
zL
,
L2
,
ftphi
,
ftz
;
double
sqrtD
;
double
sqrtD
;
double
lower_z
,
upper_z
;
for
(
ii
=
0
;
ii
<
inum
;
ii
++
)
{
for
(
ii
=
0
;
ii
<
inum
;
ii
++
)
{
i
=
ilist
[
ii
];
i
=
ilist
[
ii
];
...
@@ -313,11 +311,9 @@ void ComputePressureCyl::compute_array()
...
@@ -313,11 +311,9 @@ void ComputePressureCyl::compute_array()
jtag
=
tag
[
j
];
jtag
=
tag
[
j
];
if
(
itag
>
jtag
)
{
if
(
itag
>
jtag
)
{
if
((
itag
+
jtag
)
%
2
==
0
)
continue
;
if
((
itag
+
jtag
)
%
2
==
0
)
continue
;
}
}
else
if
(
itag
<
jtag
)
{
else
if
(
itag
<
jtag
)
{
if
((
itag
+
jtag
)
%
2
==
1
)
continue
;
if
((
itag
+
jtag
)
%
2
==
1
)
continue
;
}
}
else
{
else
{
if
(
x
[
j
][
2
]
<
ztmp
)
continue
;
if
(
x
[
j
][
2
]
<
ztmp
)
continue
;
if
(
x
[
j
][
2
]
==
ztmp
)
{
if
(
x
[
j
][
2
]
==
ztmp
)
{
if
(
x
[
j
][
1
]
<
ytmp
)
continue
;
if
(
x
[
j
][
1
]
<
ytmp
)
continue
;
...
@@ -342,8 +338,7 @@ void ComputePressureCyl::compute_array()
...
@@ -342,8 +338,7 @@ void ComputePressureCyl::compute_array()
dx
=
x
[
i
][
0
]
-
x
[
j
][
0
];
dx
=
x
[
i
][
0
]
-
x
[
j
][
0
];
dy
=
x
[
i
][
1
]
-
x
[
j
][
1
];
dy
=
x
[
i
][
1
]
-
x
[
j
][
1
];
dz
=
x
[
i
][
2
]
-
x
[
j
][
2
];
dz
=
x
[
i
][
2
]
-
x
[
j
][
2
];
}
}
else
{
else
{
risq
=
r1
;
risq
=
r1
;
rjsq
=
r2
;
rjsq
=
r2
;
xi
=
x
[
i
][
0
];
xi
=
x
[
i
][
0
];
...
@@ -358,7 +353,7 @@ void ComputePressureCyl::compute_array()
...
@@ -358,7 +353,7 @@ void ComputePressureCyl::compute_array()
jtype
=
type
[
j
];
jtype
=
type
[
j
];
if
(
rsq
>=
cutsq
[
itype
][
jtype
])
continue
;
if
(
rsq
>=
cutsq
[
itype
][
jtype
])
continue
;
eng
=
pair
->
single
(
i
,
j
,
itype
,
jtype
,
rsq
,
factor_coul
,
factor_lj
,
fpair
);
pair
->
single
(
i
,
j
,
itype
,
jtype
,
rsq
,
factor_coul
,
factor_lj
,
fpair
);
A
=
dx
*
dx
+
dy
*
dy
;
A
=
dx
*
dx
+
dy
*
dy
;
B
=
2.0
*
(
xi
*
dx
+
yi
*
dy
);
B
=
2.0
*
(
xi
*
dx
+
yi
*
dy
);
...
...
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