Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plumed2-fann
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Martin Kurečka
plumed2-fann
Commits
4a96057e
There was an error fetching the commit references. Please try again later.
Commit
4a96057e
authored
6 years ago
by
Gareth Tribello
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a bug that can occur when using mappings with virtual atoms
parent
87d76bda
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/mapping/Mapping.cpp
+4
-26
4 additions, 26 deletions
src/mapping/Mapping.cpp
src/mapping/Mapping.h
+0
-2
0 additions, 2 deletions
src/mapping/Mapping.h
with
4 additions
and
28 deletions
src/mapping/Mapping.cpp
+
4
−
26
View file @
4a96057e
...
@@ -103,8 +103,10 @@ Mapping::Mapping(const ActionOptions&ao):
...
@@ -103,8 +103,10 @@ Mapping::Mapping(const ActionOptions&ao):
// Get the arguments and atoms that are required
// Get the arguments and atoms that are required
std
::
vector
<
AtomNumber
>
atoms
;
std
::
vector
<
std
::
string
>
args
;
std
::
vector
<
AtomNumber
>
atoms
;
std
::
vector
<
std
::
string
>
args
;
mymap
->
getAtomAndArgumentRequirements
(
atoms
,
args
);
mymap
->
getAtomAndArgumentRequirements
(
atoms
,
args
);
requestAtoms
(
atoms
);
std
::
vector
<
Value
*>
req_args
;
std
::
vector
<
Value
*>
req_args
;
interpretArgumentList
(
args
,
req_args
);
interpretArgumentList
(
args
,
req_args
);
requestArguments
(
req_args
);
if
(
req_args
.
size
()
>
0
&&
atoms
.
size
()
>
0
)
error
(
"cannot mix atoms and arguments"
);
if
(
req_args
.
size
()
>
0
)
requestArguments
(
req_args
);
if
(
atoms
.
size
()
>
0
)
requestAtoms
(
atoms
);
// Duplicate all frames (duplicates are used by sketch-map)
// Duplicate all frames (duplicates are used by sketch-map)
// mymap->duplicateFrameList();
// mymap->duplicateFrameList();
// fframes.resize( 2*nfram, 0.0 ); dfframes.resize( 2*nfram, 0.0 );
// fframes.resize( 2*nfram, 0.0 ); dfframes.resize( 2*nfram, 0.0 );
...
@@ -124,30 +126,6 @@ void Mapping::turnOnDerivatives() {
...
@@ -124,30 +126,6 @@ void Mapping::turnOnDerivatives() {
needsDerivatives
();
needsDerivatives
();
}
}
void
Mapping
::
prepare
()
{
if
(
mymap
->
mappingNeedsSetup
()
)
{
// Get the arguments and atoms that are required
std
::
vector
<
AtomNumber
>
atoms
;
std
::
vector
<
std
::
string
>
args
;
mymap
->
getAtomAndArgumentRequirements
(
atoms
,
args
);
requestAtoms
(
atoms
);
std
::
vector
<
Value
*>
req_args
;
interpretArgumentList
(
args
,
req_args
);
requestArguments
(
req_args
);
// Duplicate all frames (duplicates are used by sketch-map)
//mymap->duplicateFrameList();
// Get the number of frames in the path
// unsigned nfram=getNumberOfReferencePoints();
// fframes.resize( 2*nfram, 0.0 ); dfframes.resize( 2*nfram, 0.0 );
// plumed_assert( !mymap->mappingNeedsSetup() );
// Resize all derivative arrays
// mymap->setNumberOfAtomsAndArguments( atoms.size(), args.size() );
// Resize forces array
if
(
getNumberOfAtoms
()
>
0
)
{
forcesToApply
.
resize
(
3
*
getNumberOfAtoms
()
+
9
+
getNumberOfArguments
()
);
}
else
{
forcesToApply
.
resize
(
getNumberOfArguments
()
);
}
}
}
unsigned
Mapping
::
getPropertyIndex
(
const
std
::
string
&
name
)
const
{
unsigned
Mapping
::
getPropertyIndex
(
const
std
::
string
&
name
)
const
{
return
mymap
->
getPropertyIndex
(
name
);
return
mymap
->
getPropertyIndex
(
name
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mapping/Mapping.h
+
0
−
2
View file @
4a96057e
...
@@ -95,8 +95,6 @@ public:
...
@@ -95,8 +95,6 @@ public:
std
::
string
getArgumentName
(
unsigned
&
iarg
);
std
::
string
getArgumentName
(
unsigned
&
iarg
);
/// Get the value of the ith property for the current frame
/// Get the value of the ith property for the current frame
double
getPropertyValue
(
const
unsigned
&
current
,
const
unsigned
&
iprop
)
const
;
double
getPropertyValue
(
const
unsigned
&
current
,
const
unsigned
&
iprop
)
const
;
/// Stuff to do before we do the calculation
void
prepare
();
/// Apply the forces
/// Apply the forces
void
apply
();
void
apply
();
};
};
...
...
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