Commit ede15c46 authored by Jens Wehner's avatar Jens Wehner

merged

parents f395b858 c9bda25c
......@@ -11,6 +11,11 @@ stages:
DISTRO: "latest"
image: votca/buildenv:${DISTRO}
stage: build
artifacts:
paths:
- ${CI_PROJECT_DIR}/votca
when: always
dependencies: []
cache:
paths:
- ccache/
......@@ -18,12 +23,14 @@ stages:
- ccache -z
- j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++))
- git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA}
- cd $HOME
- git clone --recursive https://github.com/votca/votca
- git clone https://github.com/votca/votca
- pushd votca
- if [[ ${CI_COMMIT_REF_NAME} =~ for/([^/]*)/.* && ${BASH_REMATCH[1]} != master ]]; then
git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]} && git submodule update --recursive --init;
- if [[ ${CI_COMMIT_TAG} = v[12].[0-9]* ]]; then
git checkout -b ${CI_COMMIT_TAG} ${CI_COMMIT_TAG};
elif [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then
git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]};
fi
- git submodule update --recursive --init
- git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID}
- git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID}
- git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA}
......
For more detailed information about the changes see the history of the [repository](https://github.com/votca/csg/commits/master).
## Version 1.5 _SuperVictor_ (released XX.01.19)
## Version 1.6-dev
## Version 1.5 _SuperVictor_ (released 31.01.19)
* enable gitlab CI
## Version 1.5_rc3 (released 19.01.19)
......
......@@ -68,7 +68,7 @@ else (BUILD_MANPAGES)
set(TXT2TAGS_FOUND)
endif (BUILD_MANPAGES)
find_package(Boost 1.39.0 REQUIRED COMPONENTS program_options filesystem system )
find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options filesystem system )
include_directories(${Boost_INCLUDE_DIRS})
set (BOOST_CFLAGS_PKG "-I${Boost_INCLUDE_DIRS}")
set(BOOST_LIBS_PKG "-L${Boost_LIBRARY_DIRS}")
......
......@@ -26,11 +26,10 @@
#include <votca/tools/name.h>
#include <votca/tools/vec.h>
namespace TOOLS = votca::tools;
namespace votca {
namespace csg {
using namespace votca::tools;
class BeadType;
/**
* \brief information about a base bead
......@@ -70,33 +69,15 @@ public:
/**
* get the bead type
* \return const bead type pointer
* \return const string
*/
virtual const std::weak_ptr<BeadType> getType() const { return type_; }
virtual const std::string getType() const { return type_.getName(); }
/**
* set the bead type
* \param bead type object
*/
virtual void setType(std::weak_ptr<BeadType> type) { type_ = type; }
/**
* get the bead type
* \return - non constant bead type pointer
*/
virtual std::weak_ptr<BeadType> Type() const { return type_; }
/**
* get the name of the bead type
* \return - string indicates the name
**/
std::string getBeadTypeName();
/**
* get the id of the bead type
* \return - int indicated the id
**/
int getBeadTypeId();
virtual void setType(std::string type) { type_.setName(type); }
/**
* get the mass of the base bead
......@@ -114,19 +95,19 @@ public:
* set the position of the base bead
* \param - base bead position
*/
virtual void setPos(const vec &bead_position);
virtual void setPos(const TOOLS::vec &bead_position);
/**
* get the position of the base bead
* \return base bead position
*/
virtual const vec &getPos() const;
virtual const TOOLS::vec &getPos() const;
/**
* direct access (read/write) to the position of the base bead
* \return reference to position
*/
virtual vec &Pos() {
virtual TOOLS::vec &Pos() {
assert(bead_position_set_ && "Position is not set.");
return bead_position_;
}
......@@ -145,22 +126,22 @@ protected:
TopologyItem topology_item_;
MoleculeItem molecule_item_;
Identity<int> id_;
Name name_;
std::weak_ptr<BeadType> type_;
TOOLS::Identity<int> id_;
TOOLS::Name name_;
TOOLS::Name type_;
double mass_;
vec bead_position_;
TOOLS::vec bead_position_;
bool bead_position_set_;
};
inline void BaseBead::setPos(const vec &bead_position) {
inline void BaseBead::setPos(const TOOLS::vec &bead_position) {
bead_position_set_ = true;
bead_position_ = bead_position;
}
inline const vec &BaseBead::getPos() const {
inline const TOOLS::vec &BaseBead::getPos() const {
assert(bead_position_set_ &&
"Cannot get bead position as it has not been set.");
return bead_position_;
......
......@@ -30,7 +30,6 @@
namespace votca {
namespace csg {
class BeadType;
class Topology;
class Molecule;
......@@ -314,7 +313,7 @@ protected:
bool bead_force_set_;
/// constructur
Bead(Topology *owner, int id, std::weak_ptr<BeadType> type, byte_t symmetry,
Bead(Topology *owner, int id, std::string type, byte_t symmetry,
std::string name, int resnr, double m, double q)
: symmetry_(symmetry), charge_(q), residue_number_(resnr) {
topology_item_._parent = owner;
......
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -16,13 +16,14 @@
*/
#ifndef _VOTCA_CSG_BEADLIST_H
#define _VOTCA_CSG_BEADLIST_H
#define _VOTCA_CSG_BEADLIST_H
#include <string>
#include <list>
#include "topology.h"
#include <list>
#include <string>
namespace votca { namespace csg {
namespace votca {
namespace csg {
using namespace votca::tools;
/**
......@@ -33,26 +34,25 @@ using namespace votca::tools;
*/
class BeadList
: public std::list<Bead *>
{
class BeadList : public std::list<Bead *> {
public:
BeadList() {};
~BeadList() {}
/// \brief Select all beads of type <select>
int Generate(Topology &top, const std::string &select);
/// \brief Select all beads of type <select> withn a radius <radius> of reference vector <ref>
int GenerateInSphericalSubvolume(Topology &top, const std::string &select, vec ref, double radius);
Topology *getTopology() {return _topology; }
BeadList(){};
~BeadList() {}
/// \brief Select all beads of type <select>
int Generate(Topology &top, const std::string &select);
/// \brief Select all beads of type <select> withn a radius <radius> of
/// reference vector <ref>
int GenerateInSphericalSubvolume(Topology &top, const std::string &select,
vec ref, double radius);
Topology *getTopology() { return _topology; }
private:
Topology *_topology;
Topology *_topology;
};
}}
#endif /* _VOTCA_CSG_BEADLIST_H */
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_BEADLIST_H */
......@@ -18,10 +18,11 @@
#ifndef VOTCA_CSG_BEADMOTIF_H
#define VOTCA_CSG_BEADMOTIF_H
#include "beadstructure.h"
#include <votca/csg/basebead.h>
#include <votca/tools/reducedgraph.h>
#include "beadstructure.h"
namespace TOOLS = votca::tools;
namespace votca {
namespace csg {
......@@ -106,7 +107,7 @@ namespace csg {
**/
class BeadMotif : public BeadStructure<BaseBead> {
public:
public:
enum MotifType {
empty,
single_bead,
......@@ -120,7 +121,7 @@ class BeadMotif : public BeadStructure<BaseBead> {
BeadMotif(){};
BeadMotif(const BeadStructure& structure):BeadStructure(structure){};
BeadMotif(const BeadStructure &structure) : BeadStructure(structure){};
/// Gets the motif type, calculates it first if it is not yet known
MotifType getType();
......@@ -143,7 +144,7 @@ class BeadMotif : public BeadStructure<BaseBead> {
*
* @param[in] basebead pointer
**/
void AddBead(BaseBead* basebead);
void AddBead(BaseBead *basebead);
/**
* \brief Adds a new connection to the motif
......@@ -155,13 +156,13 @@ class BeadMotif : public BeadStructure<BaseBead> {
**/
void ConnectBeads(int bead1_id, int bead2_id);
private:
private:
MotifType type_ = MotifType::undefined;
bool junctionsUpToDate_ = false;
bool type_up_to_date_ = false;
std::vector<int> junctions_;
ReducedGraph reduced_graph_;
TOOLS::ReducedGraph reduced_graph_;
void InitializeGraph_();
bool junctionExist_();
......@@ -171,7 +172,7 @@ class BeadMotif : public BeadStructure<BaseBead> {
bool isLoop_();
bool isFusedRing_();
};
} // namespace csg
} // namespace votca
} // namespace csg
} // namespace votca
#endif // VOTCA_CSG_BEADMOTIF_H
#endif // VOTCA_CSG_BEADMOTIF_H
......@@ -35,11 +35,11 @@ namespace csg {
* @param[in] - reference to beadstructure
* @return - a container of beadmotifs
**/
template <class T>
T breakIntoMotifs(BeadStructure<BaseBead>& beadstructure) {
template <class T> T breakIntoMotifs(BeadStructure<BaseBead> &beadstructure) {
T bead_motifs;
std::vector<BeadStructure<BaseBead> > structures =breakIntoStructures(beadstructure);
for (BeadStructure<BaseBead>& structure : structures) {
std::vector<BeadStructure<BaseBead>> structures =
breakIntoStructures(beadstructure);
for (BeadStructure<BaseBead> &structure : structures) {
bead_motifs.push_back(BeadMotif(structure));
}
return bead_motifs;
......@@ -77,9 +77,9 @@ T breakIntoMotifs(BeadStructure<BaseBead>& beadstructure) {
**/
std::pair<std::unordered_map<int, BeadMotif>, BeadMotifConnector>
breakIntoSimpleMotifs(BeadMotif beadmotif);
breakIntoSimpleMotifs(BeadMotif beadmotif);
} // namespace csg
} // namespace votca
} // namespace csg
} // namespace votca
#endif // VOTCA_CSG_BEADMOTIFALGORITHMS_H
#endif // VOTCA_CSG_BEADMOTIFALGORITHMS_H
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -16,40 +16,38 @@
*/
#ifndef _VOTCA_CSG_BEADPAIR_H
#define _VOTCA_CSG_BEADPAIR_H
namespace votca { namespace csg {
#define _VOTCA_CSG_BEADPAIR_H
namespace votca {
namespace csg {
/**
\brief A particle pair
This class defines a particle pair. The future plan is, that the Pair class
can be overloaded and Particle list creates these inherited pairs.
*/
class BeadPair
: public std::pair<Bead *, Bead *>
{
class BeadPair : public std::pair<Bead *, Bead *> {
public:
BeadPair() {}
BeadPair(Bead *bead1, Bead *bead2, tools::vec r)
: std::pair<Bead *, Bead *>(bead1, bead2), _r(r), _dist(abs(r)) {}
virtual ~BeadPair() {}
BeadPair() {}
BeadPair(Bead *bead1, Bead *bead2, tools::vec r)
: std::pair<Bead *, Bead *>(bead1, bead2), _r(r), _dist(abs(r)) {}
/// \brief the vector connecting two beads
tools::vec &r() { return _r; }
/// \brief the distance of the beads
double &dist() { return _dist; }
virtual ~BeadPair() {}
/// \brief the vector connecting two beads
tools::vec &r() { return _r; }
/// \brief the distance of the beads
double &dist() { return _dist; }
protected:
tools::vec _r;
double _dist;
tools::vec _r;
double _dist;
};
}}
#endif /* _VOTCA_CSG_BEADPAIR_H */
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_BEADPAIR_H */
......@@ -18,7 +18,7 @@
#ifndef _VOTCA_CSG_BEADSTRUCTURE_H
#define _VOTCA_CSG_BEADSTRUCTURE_H
#include <iostream>
#include <cassert>
#include <unordered_map>
#include <votca/tools/graph.h>
#include <votca/tools/graph_bf_visitor.h>
......@@ -178,7 +178,7 @@ TOOLS::GraphNode BeadStructure<T>::BaseBeadToGraphNode_(T *basebead) {
template <class T> void BeadStructure<T>::AddBead(T *bead) {
if (beads_.count(bead->getId())) {
std::string err = "Cannot add bead with Id ";
err += to_string(bead->getId());
err += std::to_string(bead->getId());
err += " because each bead must have a unique Id and a bead with that Id ";
err += "already exists within the beadstructure";
throw std::invalid_argument(err);
......
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -16,54 +16,55 @@
*/
#ifndef _VOTCA_CSG_BEADTRIPLE_H
#define _VOTCA_CSG_BEADTRIPLE_H
#define _VOTCA_CSG_BEADTRIPLE_H
#include <tuple>
namespace votca { namespace csg {
namespace votca {
namespace csg {
/**
\brief A particle pair
This class defines a particle pair. The future plan is, that the Pair class
can be overloaded and Particle list creates these inherited pairs.
*/
class BeadTriple
: public std::tuple<Bead *, Bead *, Bead *>
{
class BeadTriple : public std::tuple<Bead *, Bead *, Bead *> {
public:
BeadTriple() {}
BeadTriple(Bead *bead1, Bead *bead2, Bead *bead3, vec r12, vec r13, vec r23)
: std::tuple<Bead*, Bead *, Bead *>(bead1, bead2, bead3), _r12(r12), _r13(r13), _r23(r23), _dist12(abs(r12)), _dist13(abs(r13)), _dist23(abs(r23)) {}
virtual ~BeadTriple() {}
BeadTriple() {}
BeadTriple(Bead *bead1, Bead *bead2, Bead *bead3, vec r12, vec r13, vec r23)
: std::tuple<Bead *, Bead *, Bead *>(bead1, bead2, bead3), _r12(r12),
_r13(r13), _r23(r23), _dist12(abs(r12)), _dist13(abs(r13)),
_dist23(abs(r23)) {}
virtual ~BeadTriple() {}
/// \brief return the beads
const Bead * bead1() { return std::get<0>(*this); }
const Bead * bead2() { return std::get<1>(*this); }
const Bead * bead3() { return std::get<2>(*this); }
/// \brief the vector connecting two beads
vec &r12() { return _r12; }
vec &r13() { return _r13; }
vec &r23() { return _r23; }
/// \brief the distance of the beads
double &dist12() { return _dist12; }
double &dist13() { return _dist13; }
double &dist23() { return _dist23; }
/// \brief return the beads
const Bead *bead1() { return std::get<0>(*this); }
const Bead *bead2() { return std::get<1>(*this); }
const Bead *bead3() { return std::get<2>(*this); }
/// \brief the vector connecting two beads
vec &r12() { return _r12; }
vec &r13() { return _r13; }
vec &r23() { return _r23; }
/// \brief the distance of the beads
double &dist12() { return _dist12; }
double &dist13() { return _dist13; }
double &dist23() { return _dist23; }
protected:
vec _r12;
vec _r13;
vec _r23;
double _dist12;
double _dist13;
double _dist23;
vec _r12;
vec _r13;
vec _r23;
double _dist12;
double _dist13;
double _dist23;
};
}}
#endif /* _VOTCA_CSG_BEADTRIPLE_H */
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_BEADTRIPLE_H */
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -16,12 +16,13 @@
*/
#ifndef _VOTCA_CSG_BEADTYPE_H
#define _VOTCA_CSG_BEADTYPE_H
#define _VOTCA_CSG_BEADTYPE_H
#include <string>
#include "topologyitem.h"
#include <string>
namespace votca { namespace csg {
namespace votca {
namespace csg {
using namespace votca::tools;
/**
......@@ -30,22 +31,22 @@ using namespace votca::tools;
Each bead has a type. While the bead name should be unique,
several beads can share the same type.
*/
class BeadType : public TopologyItem {
public:
const int &getId() const { return _id; }
const std::string &getName() const { return _name; }
void setName(const std::string &name) { _name=name; }
class BeadType : public TopologyItem {
public:
const int &getId() const { return _id; }
const std::string &getName() const { return _name; }
void setName(const std::string &name) { _name = name; }
private:
int _id;
std::string _name;
BeadType(Topology *parent, int id, const std::string &name)
: TopologyItem(parent), _id(id), _name(name) {}
friend class Topology;
};
int _id;
std::string _name;
}}
BeadType(Topology *parent, int id, const std::string &name)
: TopologyItem(parent), _id(id), _name(name) {}
friend class Topology;
};
#endif /* _VOTCA_CSG_BEADTYPE_H */
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_BEADTYPE_H */
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -16,55 +16,51 @@
*/
#ifndef _VOTCA_CSG_BOUNDARYCONDITION_H
#define _VOTCA_CSG_BOUNDARYCONDITION_H
#define _VOTCA_CSG_BOUNDARYCONDITION_H
#include <votca/tools/matrix.h>
namespace votca { namespace csg {
namespace votca {
namespace csg {
using namespace votca::tools;
class BoundaryCondition {
public:
virtual ~BoundaryCondition() {};
virtual ~BoundaryCondition(){};
/**
* set the simulation box
* \param box triclinic box matrix
*/
void setBox(const matrix &box) { _box = box; };
/**
* set the simulation box
* \param box triclinic box matrix
*/
void setBox(const matrix &box) { _box = box; };
/**
* get the simulation box
* \return triclinic box matrix
*/
const matrix &getBox() { return _box; };
/**
* get the simulation box
* \return triclinic box matrix
*/
const matrix &getBox() { return _box; };
/**
* get the volume of the box
* \return box volume as double
*/
virtual double BoxVolume();
/**
* get the volume of the box
* \return box volume as double
*/
virtual double BoxVolume();
/**
* get shortest connection vector between r_i and r_j with respect to the (periodic) box
* \return shortest distance vector
*/
virtual vec BCShortestConnection(const vec &r_i, const vec &r_j) const = 0;
/**
* get shortest connection vector between r_i and r_j with respect to the
* (periodic) box \return shortest distance vector
*/
virtual vec BCShortestConnection(const vec &r_i, const vec &r_j) const = 0;
enum eBoxtype {
typeAuto = 0,
typeTriclinic,
typeOrthorhombic,
typeOpen
};
virtual eBoxtype getBoxType() = 0;
enum eBoxtype { typeAuto = 0, typeTriclinic, typeOrthorhombic, typeOpen };
virtual eBoxtype getBoxType() = 0;
protected:
matrix _box;
matrix _box;
};
}}
#endif /* _VOTCA_CSG_BOUNDARYCONDITION_H */
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_BOUNDARYCONDITION_H */