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
43ae9656
Commit
43ae9656
authored
6 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
add a "deprecated" command style for flagging future removed commands
parent
b02d3b1b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/deprecated.cpp
+48
-0
48 additions, 0 deletions
src/deprecated.cpp
src/deprecated.h
+70
-0
70 additions, 0 deletions
src/deprecated.h
src/input.h
+5
-1
5 additions, 1 deletion
src/input.h
src/pair_deprecated.cpp
+1
-0
1 addition, 0 deletions
src/pair_deprecated.cpp
with
124 additions
and
1 deletion
src/deprecated.cpp
0 → 100644
+
48
−
0
View file @
43ae9656
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Axel Kohlmeyer (Temple U),
------------------------------------------------------------------------- */
#include
<cstring>
#include
"deprecated.h"
#include
"comm.h"
#include
"force.h"
#include
"error.h"
#include
"input.h"
using
namespace
LAMMPS_NS
;
static
void
writemsg
(
LAMMPS
*
lmp
,
const
char
*
msg
,
int
abend
=
1
)
{
if
(
lmp
->
comm
->
me
==
0
)
{
if
(
lmp
->
screen
)
fputs
(
msg
,
lmp
->
screen
);
if
(
lmp
->
logfile
)
fputs
(
msg
,
lmp
->
logfile
);
}
if
(
abend
)
lmp
->
error
->
all
(
FLERR
,
"This command is no longer available"
);
}
/* ---------------------------------------------------------------------- */
void
Deprecated
::
command
(
int
narg
,
char
**
arg
)
{
if
(
strcmp
(
input
->
command
,
"deprecated"
)
==
0
)
{
writemsg
(
lmp
,
"
\n
Command 'deprecated' is a dummy command
\n\n
"
,
0
);
}
else
if
(
strcmp
(
input
->
command
,
"XXX"
)
==
0
)
{
writemsg
(
lmp
,
"
\n
Command 'XXX' has been removed from LAMMPS "
"after the
\n
## XXX 20## stable release.
\n\n
"
);
}
}
This diff is collapsed.
Click to expand it.
src/deprecated.h
0 → 100644
+
70
−
0
View file @
43ae9656
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle
(
deprecated
,
Deprecated
)
CommandStyle
(
XXX
,
Deprecated
)
#else
#ifndef LMP_DEPRECATED_H
#define LMP_DEPRECATED_H
#include
"pointers.h"
namespace
LAMMPS_NS
{
class
Deprecated
:
protected
Pointers
{
public:
Deprecated
(
class
LAMMPS
*
lmp
)
:
Pointers
(
lmp
)
{};
void
command
(
int
,
char
**
);
};
}
#endif
#endif
/* ERROR/WARNING messages:
W: Ignoring unknown or incorrect info command flag
Self-explanatory. An unknown argument was given to the info command.
Compare your input with the documentation.
E: Unknown name for info package category
Self-explanatory.
E: Unknown name for info newton category
Self-explanatory.
E: Unknown name for info pair category
Self-explanatory.
E: Unknown category for info is_active()
Self-explanatory.
E: Unknown category for info is_available()
Self-explanatory.
E: Unknown category for info is_defined()
Self-explanatory.
*/
This diff is collapsed.
Click to expand it.
src/input.h
+
5
−
1
View file @
43ae9656
...
...
@@ -24,6 +24,8 @@ namespace LAMMPS_NS {
class
Input
:
protected
Pointers
{
friend
class
Info
;
friend
class
Error
;
friend
class
Deprecated
;
public:
int
narg
;
// # of command args
char
**
arg
;
// parsed args for command
...
...
@@ -38,9 +40,11 @@ class Input : protected Pointers {
// substitute for variables in a string
int
expand_args
(
int
,
char
**
,
int
,
char
**&
);
// expand args due to wildcard
protected:
char
*
command
;
// ptr to current command
private:
int
me
;
// proc ID
char
*
command
;
// ptr to current command
int
maxarg
;
// max # of args in arg
char
*
line
,
*
copy
,
*
work
;
// input line & copy and work string
int
maxline
,
maxcopy
,
maxwork
;
// max lengths of char strings
...
...
This diff is collapsed.
Click to expand it.
src/pair_deprecated.cpp
+
1
−
0
View file @
43ae9656
...
...
@@ -15,6 +15,7 @@
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include
<cstring>
#include
"pair_deprecated.h"
#include
"pair_hybrid.h"
#include
"comm.h"
...
...
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