Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:25.10 AS build
FROM ubuntu:26.04 AS build

ARG DEPS="\
cmake \
Expand All @@ -8,22 +8,13 @@ ARG DEPS="\
libeigen3-dev \
libnanoflann-dev \
libomp-dev \
gemmi \
libgemmi-dev \
nlohmann-json3-dev\
python3-pybind11"

RUN apt-get update && apt-get install -y --no-install-recommends ${DEPS}

# Use newer version of Gemmi since Ubuntu currently ships only 0.6.5
ARG GEMMI_VERSION=0.7.4
ADD https://github.com/project-gemmi/gemmi/archive/refs/tags/v${GEMMI_VERSION}.tar.gz .
RUN tar xvzf v${GEMMI_VERSION}.tar.gz && \
cd gemmi-${GEMMI_VERSION} && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install

ARG PORTABLE=OFF
COPY . ChargeFW2
RUN cd ChargeFW2 && \
Expand All @@ -45,10 +36,9 @@ RUN mv /ChargeFW2/build/bin \
/build
RUN mv /usr/lib/x86_64-linux-gnu/libgomp.so.1*\
/usr/lib/x86_64-linux-gnu/libboost_program_options.so* \
/usr/local/lib/libgemmi_cpp.so* \
/dependencies

FROM ubuntu:25.10 AS app
FROM ubuntu:26.04 AS app

ENV PATH=/ChargeFW2/bin:${PATH}

Expand All @@ -58,7 +48,7 @@ COPY --from=build /dependencies/* /usr/lib/x86_64-linux-gnu/

# Setup ENV variables for use with Python bindings
ENV CHARGEFW2_INSTALL_DIR=/ChargeFW2/
ENV LD_LIBRARY_PATH=${CHARGEFW2_INSTALL_DIR}/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=${CHARGEFW2_INSTALL_DIR}/lib
ENV PYTHONPATH=${CHARGEFW2_INSTALL_DIR}/lib

USER ubuntu
Expand Down
4 changes: 2 additions & 2 deletions data/parameters/SFKEEM_00_original.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"common":
{
"names": ["sigma"],
"values": [0.65]
"values": [1.2283]
},
"atom":
{
Expand Down Expand Up @@ -36,4 +36,4 @@
}
]
}
}
}
4 changes: 4 additions & 0 deletions src/methods/eqeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

#include "eqeq.h"
#include "../geometry.h"
#include "../method_registry.h"


[[maybe_unused]] const bool EQeq_registered_ =
(MethodRegistry::register_factory("eqeq", &make_method<EQeq>), true);

Eigen::VectorXd EQeq::EE_system(const std::vector<const Atom *> &atoms, double total_charge) const {

const auto n = static_cast<Eigen::Index>(atoms.size());
Expand Down
12 changes: 12 additions & 0 deletions src/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <string>

#include "charges.h"
#include "chargefw2.h"
#include "formats/save_charges.h"
#include "method.h"
#include "parameters.h"
Expand Down Expand Up @@ -185,6 +186,17 @@ calculate_charges(struct Molecules &molecules, const std::string &method_name, s
throw std::runtime_error(std::format("Failed to load method {}: {}", method_name, e.what()));
}

if (not method->is_suitable_for_large_molecule()) {
for (const auto &mol : molecules.ms.molecules()) {
if (mol.atoms().size() > LARGE_MOLECULE_ATOM_COUNT) {
throw std::runtime_error(std::format(
"Method '{}' is not suitable for molecules with more than {} atoms.",
method_name, LARGE_MOLECULE_ATOM_COUNT
));
}
}
}

molecules.ms.fulfill_requirements(method->get_requirements());

std::unique_ptr<Parameters> parameters;
Expand Down
Loading