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
09544d06
Commit
09544d06
authored
8 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
bugfix for compute pressure/grem: must make a copy of argument strings
parent
20daf824
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/USER-MISC/compute_pressure_grem.cpp
+12
-4
12 additions, 4 deletions
src/USER-MISC/compute_pressure_grem.cpp
src/USER-MISC/compute_pressure_grem.h
+1
-1
1 addition, 1 deletion
src/USER-MISC/compute_pressure_grem.h
with
13 additions
and
5 deletions
src/USER-MISC/compute_pressure_grem.cpp
+
12
−
4
View file @
09544d06
...
@@ -34,11 +34,19 @@ using namespace LAMMPS_NS;
...
@@ -34,11 +34,19 @@ using namespace LAMMPS_NS;
ComputePressureGrem
::
ComputePressureGrem
(
LAMMPS
*
lmp
,
int
narg
,
char
**
arg
)
:
ComputePressureGrem
::
ComputePressureGrem
(
LAMMPS
*
lmp
,
int
narg
,
char
**
arg
)
:
ComputePressure
(
lmp
,
narg
-
1
,
arg
)
ComputePressure
(
lmp
,
narg
-
1
,
arg
)
{
{
fix_grem
=
arg
[
narg
-
1
];
int
len
=
strlen
(
arg
[
narg
-
1
])
+
1
;
fix_grem
=
new
char
[
len
];
strcpy
(
fix_grem
,
arg
[
narg
-
1
]);
}
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
ComputePressureGrem
::~
ComputePressureGrem
()
{
delete
[]
fix_grem
;
}
/* ---------------------------------------------------------------------- */
void
ComputePressureGrem
::
init
()
void
ComputePressureGrem
::
init
()
{
{
ComputePressure
::
init
();
ComputePressure
::
init
();
...
@@ -70,8 +78,8 @@ double ComputePressureGrem::compute_scalar()
...
@@ -70,8 +78,8 @@ double ComputePressureGrem::compute_scalar()
double
t
;
double
t
;
if
(
keflag
)
{
if
(
keflag
)
{
if
(
temperature
->
invoked_scalar
!=
update
->
ntimestep
)
if
(
temperature
->
invoked_scalar
!=
update
->
ntimestep
)
t
=
temperature
->
compute_scalar
()
*
(
*
scale_grem
);
t
=
temperature
->
compute_scalar
()
/
(
*
scale_grem
);
else
t
=
temperature
->
scalar
*
(
*
scale_grem
);
else
t
=
temperature
->
scalar
/
(
*
scale_grem
);
}
}
if
(
dimension
==
3
)
{
if
(
dimension
==
3
)
{
...
@@ -119,7 +127,7 @@ void ComputePressureGrem::compute_vector()
...
@@ -119,7 +127,7 @@ void ComputePressureGrem::compute_vector()
ke_tensor
=
temperature
->
vector
;
ke_tensor
=
temperature
->
vector
;
}
}
for
(
int
i
=
0
;
i
<
6
;
i
++
)
for
(
int
i
=
0
;
i
<
6
;
i
++
)
ke_tensor
[
i
]
*
=
*
scale_grem
;
ke_tensor
[
i
]
/
=
*
scale_grem
;
if
(
dimension
==
3
)
{
if
(
dimension
==
3
)
{
inv_volume
=
1.0
/
(
domain
->
xprd
*
domain
->
yprd
*
domain
->
zprd
);
inv_volume
=
1.0
/
(
domain
->
xprd
*
domain
->
yprd
*
domain
->
zprd
);
...
...
This diff is collapsed.
Click to expand it.
src/USER-MISC/compute_pressure_grem.h
+
1
−
1
View file @
09544d06
...
@@ -27,7 +27,7 @@ namespace LAMMPS_NS {
...
@@ -27,7 +27,7 @@ namespace LAMMPS_NS {
class
ComputePressureGrem
:
public
ComputePressure
{
class
ComputePressureGrem
:
public
ComputePressure
{
public:
public:
ComputePressureGrem
(
class
LAMMPS
*
,
int
,
char
**
);
ComputePressureGrem
(
class
LAMMPS
*
,
int
,
char
**
);
virtual
~
ComputePressureGrem
()
{}
;
virtual
~
ComputePressureGrem
();
virtual
void
init
();
virtual
void
init
();
virtual
double
compute_scalar
();
virtual
double
compute_scalar
();
virtual
void
compute_vector
();
virtual
void
compute_vector
();
...
...
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