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
05e3eea7
There was an error fetching the commit references. Please try again later.
Commit
05e3eea7
authored
7 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
unique_ptr: some in mapping
parent
293d2d2a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/mapping/Mapping.cpp
+1
-5
1 addition, 5 deletions
src/mapping/Mapping.cpp
src/mapping/Mapping.h
+2
-2
2 additions, 2 deletions
src/mapping/Mapping.h
src/mapping/PCAVars.cpp
+3
-8
3 additions, 8 deletions
src/mapping/PCAVars.cpp
src/mapping/PathTools.cpp
+3
-3
3 additions, 3 deletions
src/mapping/PathTools.cpp
with
9 additions
and
18 deletions
src/mapping/Mapping.cpp
+
1
−
5
View file @
05e3eea7
...
...
@@ -56,7 +56,7 @@ Mapping::Mapping(const ActionOptions&ao):
std
::
string
mtype
;
parse
(
"TYPE"
,
mtype
);
bool
skipchecks
;
parseFlag
(
"DISABLE_CHECKS"
,
skipchecks
);
// Setup the object that does the mapping
mymap
=
new
PointWiseMapping
(
mtype
,
skipchecks
);
mymap
.
reset
(
new
PointWiseMapping
(
mtype
,
skipchecks
)
);
// Read the properties we require
if
(
keywords
.
exists
(
"PROPERTY"
)
)
{
...
...
@@ -124,10 +124,6 @@ void Mapping::turnOnDerivatives() {
needsDerivatives
();
}
Mapping
::~
Mapping
()
{
delete
mymap
;
}
void
Mapping
::
prepare
()
{
if
(
mymap
->
mappingNeedsSetup
()
)
{
// Get the arguments and atoms that are required
...
...
This diff is collapsed.
Click to expand it.
src/mapping/Mapping.h
+
2
−
2
View file @
05e3eea7
...
...
@@ -28,6 +28,7 @@
#include
"vesselbase/ActionWithVessel.h"
#include
"reference/PointWiseMapping.h"
#include
<vector>
#include
<memory>
namespace
PLMD
{
...
...
@@ -46,7 +47,7 @@ private:
// The derivative wrt to the distance from the frame
std
::
vector
<
double
>
dfframes
;
/// This holds all the reference information
PointWiseMapping
*
mymap
;
std
::
unique_ptr
<
PointWiseMapping
>
mymap
;
/// The forces on each of the derivatives (used in apply)
std
::
vector
<
double
>
forcesToApply
;
protected:
...
...
@@ -69,7 +70,6 @@ protected:
public:
static
void
registerKeywords
(
Keywords
&
keys
);
explicit
Mapping
(
const
ActionOptions
&
);
~
Mapping
();
/// Overload the virtual functions that appear in both ActionAtomistic and ActionWithArguments
void
turnOnDerivatives
();
void
calculateNumericalDerivatives
(
ActionWithValue
*
a
=
NULL
);
...
...
This diff is collapsed.
Click to expand it.
src/mapping/PCAVars.cpp
+
3
−
8
View file @
05e3eea7
...
...
@@ -176,7 +176,7 @@ private:
MultiValue
myvals
;
ReferenceValuePack
mypack
;
/// The position of the reference configuration (the one we align to)
ReferenceConfiguration
*
myref
;
std
::
unique_ptr
<
ReferenceConfiguration
>
myref
;
/// The eigenvectors we are interested in
std
::
vector
<
Direction
>
directions
;
/// Stuff for applying forces
...
...
@@ -184,7 +184,6 @@ private:
public:
static
void
registerKeywords
(
Keywords
&
keys
);
explicit
PCAVars
(
const
ActionOptions
&
);
~
PCAVars
();
unsigned
getNumberOfDerivatives
();
void
lockRequests
();
void
unlockRequests
();
...
...
@@ -239,8 +238,8 @@ PCAVars::PCAVars(const ActionOptions& ao):
expandArgKeywordInPDB
(
mypdb
);
if
(
do_read
)
{
if
(
nfram
==
0
)
{
myref
=
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
mypdb
);
Direction
*
tdir
=
dynamic_cast
<
Direction
*>
(
myref
);
myref
.
reset
(
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
mypdb
)
);
Direction
*
tdir
=
dynamic_cast
<
Direction
*>
(
myref
.
get
()
);
if
(
tdir
)
error
(
"first frame should be reference configuration - not direction of vector"
);
if
(
!
myref
->
pcaIsEnabledForThisReference
()
)
error
(
"can't do PCA with reference type "
+
mtype
);
std
::
vector
<
std
::
string
>
remarks
(
mypdb
.
getRemark
()
);
std
::
string
rtype
;
...
...
@@ -311,10 +310,6 @@ PCAVars::PCAVars(const ActionOptions& ao):
for
(
unsigned
i
=
0
;
i
<
getNumberOfComponents
();
++
i
)
getPntrToComponent
(
i
)
->
resizeDerivatives
(
nder
);
}
PCAVars
::~
PCAVars
()
{
delete
myref
;
}
unsigned
PCAVars
::
getNumberOfDerivatives
()
{
if
(
getNumberOfAtoms
()
>
0
)
{
return
3
*
getNumberOfAtoms
()
+
9
+
getNumberOfArguments
();
...
...
This diff is collapsed.
Click to expand it.
src/mapping/PathTools.cpp
+
3
−
3
View file @
05e3eea7
...
...
@@ -207,14 +207,14 @@ int PathTools::main(FILE* in, FILE*out,Communicator& pc) {
std
::
string
istart
;
parse
(
"--start"
,
istart
);
FILE
*
fp2
=
fopen
(
istart
.
c_str
(),
"r"
);
PDB
mystartpdb
;
if
(
istart
.
length
()
==
0
)
error
(
"input is missing use --istart + --iend or --path"
);
if
(
!
mystartpdb
.
readFromFilepointer
(
fp2
,
false
,
0.1
)
)
error
(
"could not read fila "
+
istart
);
ReferenceConfiguration
*
sframe
=
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
mystartpdb
);
std
::
unique_ptr
<
ReferenceConfiguration
>
sframe
(
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
mystartpdb
)
);
fclose
(
fp2
);
// Read final frame
std
::
string
iend
;
parse
(
"--end"
,
iend
);
FILE
*
fp1
=
fopen
(
iend
.
c_str
(),
"r"
);
PDB
myendpdb
;
if
(
iend
.
length
()
==
0
)
error
(
"input is missing using --istart + --iend or --path"
);
if
(
!
myendpdb
.
readFromFilepointer
(
fp1
,
false
,
0.1
)
)
error
(
"could not read fila "
+
iend
);
ReferenceConfiguration
*
eframe
=
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
myendpdb
);
std
::
unique_ptr
<
ReferenceConfiguration
>
eframe
(
metricRegister
().
create
<
ReferenceConfiguration
>
(
mtype
,
myendpdb
)
);
fclose
(
fp1
);
// Get atoms and arg requests
...
...
@@ -286,7 +286,7 @@ int PathTools::main(FILE* in, FILE*out,Communicator& pc) {
for
(
unsigned
i
=
0
;
i
<
final_path
.
size
();
++
i
)
{
final_path
[
i
]
->
print
(
ofile
,
ofmt
,
10.
);
delete
final_path
[
i
];
}
// Delete the args as we don't need them anymore
for
(
unsigned
i
=
0
;
i
<
args
.
size
();
++
i
)
delete
args
[
i
];
ofile
.
close
();
delete
sframe
;
delete
eframe
;
return
0
;
ofile
.
close
();
return
0
;
}
}
// End of namespace
...
...
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