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
9480b942
There was an error fetching the commit references. Please try again later.
Commit
9480b942
authored
11 years ago
by
Carlo Camilloni
Browse files
Options
Downloads
Patches
Plain Diff
AlphaBeta Multicolvar
parent
3d26b69f
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/multicolvar/AlphaBeta.cpp
+110
-0
110 additions, 0 deletions
src/multicolvar/AlphaBeta.cpp
with
110 additions
and
0 deletions
src/multicolvar/AlphaBeta.cpp
0 → 100644
+
110
−
0
View file @
9480b942
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2013 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed-code.org for more information.
This file is part of plumed, version 2.0.
plumed is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
plumed is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with plumed. If not, see <http://www.gnu.org/licenses/>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#include
"MultiColvar.h"
#include
"tools/Torsion.h"
#include
"core/ActionRegister.h"
#include
<string>
#include
<cmath>
using
namespace
std
;
namespace
PLMD
{
namespace
multicolvar
{
//+PLUMEDOC MCOLVAR ALPHABETA
/*
*/
//+ENDPLUMEDOC
class
AlphaBeta
:
public
MultiColvar
{
private:
double
target
;
public:
static
void
registerKeywords
(
Keywords
&
keys
);
AlphaBeta
(
const
ActionOptions
&
);
virtual
double
compute
(
const
unsigned
&
j
);
bool
isPeriodic
(){
return
false
;
}
Vector
getCentralAtom
();
};
PLUMED_REGISTER_ACTION
(
AlphaBeta
,
"ALPHABETA"
)
void
AlphaBeta
::
registerKeywords
(
Keywords
&
keys
){
MultiColvar
::
registerKeywords
(
keys
);
keys
.
use
(
"ATOMS"
);
keys
.
add
(
"optional"
,
"REFERENCE"
,
"a single reference value for all the dihedrals"
);
//keys.add("optional","REFERENCE1","specific reference value for each dihedral");
}
AlphaBeta
::
AlphaBeta
(
const
ActionOptions
&
ao
)
:
PLUMED_MULTICOLVAR_INIT
(
ao
)
{
// Read in the atoms
int
natoms
=
4
;
readAtoms
(
natoms
);
parse
(
"REFERENCE"
,
target
);
// And setup the ActionWithVessel
std
::
string
fake_input
;
addVessel
(
"SUM"
,
fake_input
,
-
1
);
// -1 here means that this value will be named getLabel()
readVesselKeywords
();
// And check everything has been read in correctly
checkRead
();
}
double
AlphaBeta
::
compute
(
const
unsigned
&
j
){
Vector
d0
,
d1
,
d2
;
d0
=
getSeparation
(
getPosition
(
1
),
getPosition
(
0
));
d1
=
getSeparation
(
getPosition
(
2
),
getPosition
(
1
));
d2
=
getSeparation
(
getPosition
(
3
),
getPosition
(
2
));
Vector
dd0
,
dd1
,
dd2
;
PLMD
::
Torsion
t
;
double
value
=
t
.
compute
(
d0
,
d1
,
d2
,
dd0
,
dd1
,
dd2
);
double
svalue
=
-
0.5
*
sin
(
value
-
target
);
double
cvalue
=
1.
+
cos
(
value
-
target
);
dd0
*=
-
svalue
;
dd1
*=
-
svalue
;
dd2
*=
-
svalue
;
value
=
0.5
*
cvalue
;
addAtomsDerivatives
(
0
,
dd0
);
addAtomsDerivatives
(
1
,
dd1
-
dd0
);
addAtomsDerivatives
(
2
,
dd2
-
dd1
);
addAtomsDerivatives
(
3
,
-
dd2
);
addBoxDerivatives
(
-
(
extProduct
(
d0
,
dd0
)
+
extProduct
(
d1
,
dd1
)
+
extProduct
(
d2
,
dd2
)));
return
value
;
}
Vector
AlphaBeta
::
getCentralAtom
(){
addCentralAtomDerivatives
(
0
,
0.25
*
Tensor
::
identity
()
);
addCentralAtomDerivatives
(
1
,
0.25
*
Tensor
::
identity
()
);
addCentralAtomDerivatives
(
2
,
0.25
*
Tensor
::
identity
()
);
addCentralAtomDerivatives
(
3
,
0.25
*
Tensor
::
identity
()
);
return
0.25
*
(
getPosition
(
0
)
+
getPosition
(
1
)
+
getPosition
(
2
)
+
getPosition
(
3
)
);
}
}
}
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