Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:jimlutsko/classicalDFT into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JFL committed Sep 7, 2023
2 parents 97d3c32 + c4ef2b3 commit 95a0ad7
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 860 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.10)

set(USE_OMP true)
set(USE_MPI false)
set(USE_SLEPC false)
set(USE_MPI true)

set(USE_FMT_WEIGHTS_BEFORE_JUN_2021 false)
set(USE_FMT_WEIGHTS_BEFORE_JAN_2023 false)
Expand Down Expand Up @@ -47,8 +46,6 @@ set(all_SRCS
${PROJECT_SOURCE_DIR}/src/DDFT.cpp
${PROJECT_SOURCE_DIR}/src/Arnoldi.cpp
${PROJECT_SOURCE_DIR}/src/Eigenvalues.cpp
${PROJECT_SOURCE_DIR}/src/DFT_Petsc.cpp
${PROJECT_SOURCE_DIR}/src/DFT_Slepc.cpp
${PROJECT_SOURCE_DIR}/src/Log_Det.cpp
${PROJECT_SOURCE_DIR}/src/Interaction.cpp
${PROJECT_SOURCE_DIR}/src/GitSHA1.cpp
Expand All @@ -70,17 +67,6 @@ link_directories("/usr/local/lib")

target_link_libraries(${PROJECT_NAME} PUBLIC Boost::serialization)

message("USE_SLEPC = " ${USE_SLEPC})

if(USE_SLEPC)
find_package(PkgConfig REQUIRED)
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
pkg_check_modules(PETSC_PKG REQUIRED IMPORTED_TARGET $ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig/PETSc.pc)
pkg_check_modules(SLEPC_PKG REQUIRED IMPORTED_TARGET $ENV{SLEPC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig/slepc.pc)
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_SLEPC)
target_link_libraries(${PROJECT_NAME} PUBLIC PkgConfig::PETSC_PKG PkgConfig::SLEPC_PKG)
endif()

message("USE_MPI = " ${USE_MPI})

if(USE_MPI)
Expand Down
104 changes: 0 additions & 104 deletions include/DFT_Slepc.h

This file was deleted.

3 changes: 3 additions & 0 deletions include/Density.h
Expand Up @@ -97,6 +97,9 @@ class Density : public Lattice
// get neighboring values: the return value is the density at pos.
double get_neighbor_values(long pos,double &xpx, double &xmx, double &xpy, double &xmy, double &xpz, double &xmz) const;

DFT_Vec get_average_over_xy_cooordinates() const;
DFT_Vec get_average_over_z_cooordinate() const;

// do stuff to the density

void operator*=(double a) { Density_.MultBy(a);}
Expand Down
6 changes: 4 additions & 2 deletions include/Minimizer.h
Expand Up @@ -33,8 +33,10 @@ class Minimizer
void setVerbose(bool verbose) { verbose_ = verbose;}
void set_use_squared_forces(bool b) { use_squared_forces_ = b;}

const DFT_Vec& get_fixed_direction() {return fixed_direction_;}
const DFT_Vec& get_fixed_direction(int i=0) {return fixed_directions_[i];}
void reset_fixed_directions();
void set_fixed_direction(const DFT_Vec& fixed, bool already_using_density_alias);
void add_fixed_direction(const DFT_Vec& fixed, bool already_using_density_alias);
void flip_forces_along_fixed_direction(bool b=true) {flip_forces_along_fixed_direction_ = b;}

// report activity
Expand Down Expand Up @@ -65,7 +67,7 @@ class Minimizer
double minDensity_ = -1;
int image_number_ = 0;

DFT_Vec fixed_direction_;
vector<DFT_Vec> fixed_directions_;
bool flip_forces_along_fixed_direction_ = false;

mutable std::chrono::duration<double> elapsed_seconds_;
Expand Down

0 comments on commit 95a0ad7

Please sign in to comment.