Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
reiher-research-group committed Apr 27, 2020
1 parent b06d2fd commit 092ced6
Show file tree
Hide file tree
Showing 25 changed files with 1,319 additions and 159 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Release 2.0.0

- Replace Boost HANA with Boost MPL. Note that this changes all the interfaces;
Core 2.0.0 is therefore not backwards compatible.
- Various bugfixes and improvements.

## Release 1.0.0

Initial release with all necessary functionality to support Sparrow and ReaDuct.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.9)
# tree must then provide a properly namespaced target with the same name as
# your project.
project(Core
VERSION 1.0.0
VERSION 2.0.0
DESCRIPTION "Module management and core interface definitions"
)

Expand All @@ -15,5 +15,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ComponentSetup)
scine_setup_component()

# Testing
if(SCINE_BUILD_TESTS)
enable_testing()
endif()

# Subdirectories
add_subdirectory(src)
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Contributing to SCINE Core
==========================

Contribution Process
--------------------

The development for this code is done in a private repository maintained by the
Reiher Research Group. GitHub is only used for the official releases.

If you would like to contribute a larger change, please write to <[email protected]>.
For smaller changes, you can create a pull request on GitHub. If we agree with
the changes, a member of the Reiher Research Group will include them in our
development code. Of course, we will give proper acknowledgment for any external
contribution (see below for a list of all contributors). As soon as these changes
are available in an official release, we will close the corresponding pull requests
and/or issues on GitHub.

Please note that contributing a small change does in no way mean that you will
be added to the author list of a future paper and/or Zenodo entry!


Main Contributors
-----------------

Almost all contributions to SCINE in general and this repository in specific come
from members of the Reiher research group.


Further Contributors
--------------------

So far, no one else has contributed to this repository.
10 changes: 9 additions & 1 deletion src/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ target_link_libraries(Core
Boost::system
)

if(NOT "${SCINE_MARCH}" STREQUAL "" AND NOT MSVC)
target_compile_options(Core PUBLIC -march=${SCINE_MARCH})
endif()


# Add namespaced aliases
add_library(Scine::Core ALIAS Core)
add_library(Scine::Core ALIAS Core)

# -- Define Install
# Headers
Expand All @@ -48,3 +52,7 @@ scine_install_component_cmake_files(
COMPONENT Core
EXPORT_NAME CoreTargets
)

if(SCINE_BUILD_TESTS)
add_subdirectory(Tests)
endif()
61 changes: 61 additions & 0 deletions src/Core/Core/BaseClasses/ObjectWithStructure.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.\n
* See LICENSE.txt for details.
*/
#ifndef CORE_OBJECTWITHSTRUCTURE_H
#define CORE_OBJECTWITHSTRUCTURE_H

#include <Eigen/Core>
#include <memory>

namespace Scine {
namespace Utils {
using PositionCollection = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>;
class AtomCollection;
} // namespace Utils
namespace Core {

/**
* @class ObjectWithStructure @file ObjectWithStructure.h
* @brief Interface class defining an entity having a molecular structure.
* This solves the diamond inheritance problem where multiple different classes have a setStructure() method.
* A derived class cannot know which method to choose from.
* This way, there is only one setStructure() method.
*/
class ObjectWithStructure {
public:
ObjectWithStructure() = default;
virtual ~ObjectWithStructure() = default;

/**
* @brief Sets (or changes) the molecular structure.
*
* @param structure A new Utils::AtomCollection to set.
*/
virtual void setStructure(const Utils::AtomCollection& structure) = 0;
/**
* @brief Returns the molecular structure.
*
* @return The molecular structure as const Utils::AtomCollection&.
*/
virtual std::unique_ptr<Utils::AtomCollection> getStructure() const = 0;
/**
* @brief Modifies the atomic coordinates of the molecular structure.
*
* @param newPositions The new atomic coordinates to be assigned to the underlying Utils::AtomCollection.
*/
virtual void modifyPositions(Utils::PositionCollection newPositions) = 0;
/**
* @brief Getter for the atomic coordinates of the molecular structure.
*
* @return The atomic coordinates as const Utils::PositionCollection&.
*/
virtual const Utils::PositionCollection& getPositions() const = 0;
};

} // namespace Core
} // namespace Scine

#endif // CORE_OBJECTWITHSTRUCTURE_H
72 changes: 72 additions & 0 deletions src/Core/Core/BaseClasses/StateHandableObject.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* @file StateHandableObject.h
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.\n
* See LICENSE.txt for details.
*/
#ifndef CORE_STATEHANDABLEOBJECT_H_
#define CORE_STATEHANDABLEOBJECT_H_
/* External Includes */
#include <memory>

namespace Scine {
namespace Core {

/**
* @brief A naming interface for all states to be handled in SCINE
*/
class State {
public:
/// @brief Default constructor.
State() = default;
/// @brief Default destrucor.
virtual ~State() = default;
};

/**
* @brief An interface for all objects that should have a handable state.
*
* All objects that have a state or a configuration that should be extractable
* and loadable should inherit from this interface.
*
* The state of such an object is to be encoded into a class derived from State.
* A state should represent a momentary snapshot of a given object
*
* Each such object must then implement the loadState() and getState()
* functions which are hooks for further utilities. These utilities, such as a
* StatesHandler can be found in the Scine::Utils namespace/repository.
*/
class StateHandableObject {
public:
/// @brief Default constructor.
StateHandableObject() = default;
/// @brief Default destrucor.
virtual ~StateHandableObject() = default;
/**
* @brief Loads a given state into the object.
*
* Note that the loaded state may be mutated by the object. It is not
* necessarily copied into the object, even though this is likely the default
* behaviour. Please read the documentation of the specific implementation for
* further details.
*
* @param state The state to be loaded into the object.
*/
virtual void loadState(std::shared_ptr<State> state) = 0;
/**
* @brief Get the current state of the object.
*
* Note that the state is possibly a mutable representation of the current state
* of the object.It is not necessarily a deepcopy, eventhough this is likely the
* default behaviour. Please read the documentation of the specific
* implementation for further details.
*
* @return std::shared_ptr<State> The current state of the object.
*/
virtual std::shared_ptr<State> getState() const = 0;
};

} /* namespace Core */
} /* namespace Scine */

#endif /* CORE_STATEHANDABLEOBJECT_H_ */
Loading

0 comments on commit 092ced6

Please sign in to comment.