Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Plumed AlphaFold
Commits
695b6090
There was an error fetching the commit references. Please try again later.
Commit
695b6090
authored
5 years ago
by
Omar Valsson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a problem with updating of VES bias
parent
b90c2826
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/ves/VesLinearExpansion.cpp
+27
-8
27 additions, 8 deletions
src/ves/VesLinearExpansion.cpp
with
27 additions
and
8 deletions
src/ves/VesLinearExpansion.cpp
+
27
−
8
View file @
695b6090
...
@@ -287,10 +287,14 @@ private:
...
@@ -287,10 +287,14 @@ private:
LinearBasisSetExpansion
*
bias_expansion_pntr_
;
LinearBasisSetExpansion
*
bias_expansion_pntr_
;
size_t
ncoeffs_
;
size_t
ncoeffs_
;
Value
*
valueForce2_
;
Value
*
valueForce2_
;
bool
all_values_inside
;
std
::
vector
<
double
>
bf_values
;
bool
bf_values_set
;
public:
public:
explicit
VesLinearExpansion
(
const
ActionOptions
&
);
explicit
VesLinearExpansion
(
const
ActionOptions
&
);
~
VesLinearExpansion
();
~
VesLinearExpansion
();
void
calculate
();
void
calculate
();
void
update
();
void
updateTargetDistributions
();
void
updateTargetDistributions
();
void
restartTargetDistributions
();
void
restartTargetDistributions
();
//
//
...
@@ -334,7 +338,10 @@ VesLinearExpansion::VesLinearExpansion(const ActionOptions&ao):
...
@@ -334,7 +338,10 @@ VesLinearExpansion::VesLinearExpansion(const ActionOptions&ao):
nargs_
(
getNumberOfArguments
()),
nargs_
(
getNumberOfArguments
()),
basisf_pntrs_
(
0
),
basisf_pntrs_
(
0
),
bias_expansion_pntr_
(
NULL
),
bias_expansion_pntr_
(
NULL
),
valueForce2_
(
NULL
)
valueForce2_
(
NULL
),
all_values_inside
(
true
),
bf_values
(
0
),
bf_values_set
(
false
)
{
{
std
::
vector
<
std
::
string
>
basisf_labels
;
std
::
vector
<
std
::
string
>
basisf_labels
;
parseMultipleValues
(
"BASIS_FUNCTIONS"
,
basisf_labels
,
nargs_
);
parseMultipleValues
(
"BASIS_FUNCTIONS"
,
basisf_labels
,
nargs_
);
...
@@ -367,6 +374,7 @@ VesLinearExpansion::VesLinearExpansion(const ActionOptions&ao):
...
@@ -367,6 +374,7 @@ VesLinearExpansion::VesLinearExpansion(const ActionOptions&ao):
bias_expansion_pntr_
->
linkVesBias
(
this
);
bias_expansion_pntr_
->
linkVesBias
(
this
);
bias_expansion_pntr_
->
setGridBins
(
this
->
getGridBins
());
bias_expansion_pntr_
->
setGridBins
(
this
->
getGridBins
());
//
//
bf_values
.
assign
(
ncoeffs_
,
0.0
);
...
@@ -410,17 +418,16 @@ void VesLinearExpansion::calculate() {
...
@@ -410,17 +418,16 @@ void VesLinearExpansion::calculate() {
std
::
vector
<
double
>
cv_values
(
nargs_
);
std
::
vector
<
double
>
cv_values
(
nargs_
);
std
::
vector
<
double
>
forces
(
nargs_
);
std
::
vector
<
double
>
forces
(
nargs_
);
std
::
vector
<
double
>
coeffsderivs_values
(
ncoeffs_
);
for
(
unsigned
int
k
=
0
;
k
<
nargs_
;
k
++
)
{
for
(
unsigned
int
k
=
0
;
k
<
nargs_
;
k
++
)
{
cv_values
[
k
]
=
getArgument
(
k
);
cv_values
[
k
]
=
getArgument
(
k
);
}
}
bool
all
_inside
=
true
;
all_values
_inside
=
true
;
double
bias
=
bias_expansion_pntr_
->
getBiasAndForces
(
cv_values
,
all_inside
,
forces
,
coeffsderivs
_values
);
double
bias
=
bias_expansion_pntr_
->
getBiasAndForces
(
cv_values
,
all_
values_
inside
,
forces
,
bf
_values
);
if
(
biasCutoffActive
())
{
if
(
biasCutoffActive
())
{
applyBiasCutoff
(
bias
,
forces
,
coeffsderivs
_values
);
applyBiasCutoff
(
bias
,
forces
,
bf
_values
);
coeffsderivs
_values
[
0
]
=
1.0
;
bf
_values
[
0
]
=
1.0
;
}
}
double
totalForce2
=
0.0
;
double
totalForce2
=
0.0
;
for
(
unsigned
int
k
=
0
;
k
<
nargs_
;
k
++
)
{
for
(
unsigned
int
k
=
0
;
k
<
nargs_
;
k
++
)
{
...
@@ -430,12 +437,24 @@ void VesLinearExpansion::calculate() {
...
@@ -430,12 +437,24 @@ void VesLinearExpansion::calculate() {
setBias
(
bias
);
setBias
(
bias
);
valueForce2_
->
set
(
totalForce2
);
valueForce2_
->
set
(
totalForce2
);
if
(
all_inside
)
{
addToSampledAverages
(
coeffsderivs_values
);
bf_values_set
=
true
;
}
void
VesLinearExpansion
::
update
()
{
plumed_assert
(
bf_values_set
);
if
(
all_values_inside
&&
bf_values_set
)
{
addToSampledAverages
(
bf_values
);
}
}
bf_values_set
=
false
;
}
}
void
VesLinearExpansion
::
updateTargetDistributions
()
{
void
VesLinearExpansion
::
updateTargetDistributions
()
{
bias_expansion_pntr_
->
updateTargetDistribution
();
bias_expansion_pntr_
->
updateTargetDistribution
();
setTargetDistAverages
(
bias_expansion_pntr_
->
TargetDistAverages
());
setTargetDistAverages
(
bias_expansion_pntr_
->
TargetDistAverages
());
...
...
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