Skip to content

Commit

Permalink
Changed ENABLE_PERIODIC_BC to USE_COMPLEX everywhere. Changed nonPeri…
Browse files Browse the repository at this point in the history
…odic and Periodic compilation folders to double and complex
  • Loading branch information
dsambit committed May 10, 2018
1 parent e4a5942 commit b21434f
Show file tree
Hide file tree
Showing 64 changed files with 196 additions and 196 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ SET(WARNINGSLIST "-w -Wno-sign-compare -Wno-ignored-qualifiers -Wno-deprecated-
SET(DEAL_II_CXX_FLAGS "${DEAL_II_CXX_FLAGS} ${WARNINGSLIST}" )

#
#Set periodic BC flag
#Set use complex/use double flag
#
IF (DEAL_II_PETSC_WITH_COMPLEX)
ADD_DEFINITIONS(-DENABLE_PERIODIC_BC)
MESSAGE(STATUS "Periodic")
ADD_DEFINITIONS(-DUSE_COMPLEX)
MESSAGE(STATUS "Using complex")
ELSE()
ADD_DEFINITIONS(-DDISABLE_PERIODIC_BC)
MESSAGE(STATUS "Non-periodic")
ADD_DEFINITIONS(-DUSE_DOUBLE)
MESSAGE(STATUS "Using double")
ENDIF()

ADD_LIBRARY(${TARGETLIB} SHARED
Expand Down Expand Up @@ -220,7 +220,7 @@ INCLUDE(CTest)
SET (TEST_TIME_LIMIT 3600)
#
IF (DEAL_II_PETSC_WITH_COMPLEX)
ADD_SUBDIRECTORY(tests/dft/pseudopotential/periodic)
ADD_SUBDIRECTORY(tests/dft/pseudopotential/complex)
ELSE()
ADD_SUBDIRECTORY(tests/dft/pseudopotential/nonPeriodic)
ADD_SUBDIRECTORY(tests/dft/pseudopotential/double)
ENDIF()
4 changes: 2 additions & 2 deletions include/dft.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ namespace dftfe {
* periodic boundary conditions
*/

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::complex<double> innerProduct(vectorType & a,
vectorType & b);

Expand Down Expand Up @@ -517,7 +517,7 @@ namespace dftfe {
IndexSet d_locallyOwnedProjectorIdsCurrentProcess;
IndexSet d_ghostProjectorIdsCurrentProcess;
std::map<std::pair<unsigned int,unsigned int>, unsigned int> d_projectorIdsNumberingMapCurrentProcess;
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::vector<std::vector<std::vector<std::vector<std::complex<double> > > > > d_nonLocalProjectorElementMatrices,d_nonLocalProjectorElementMatricesConjugate;
std::vector<dealii::parallel::distributed::Vector<std::complex<double> > > d_projectorKetTimesVectorPar;
#else
Expand Down
6 changes: 3 additions & 3 deletions include/eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace dftfe{



#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/**
* @brief Compute discretized operator matrix times complex type multi-vectors and add it to the existing dst vector
*
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace dftfe{



#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX

/**
* @brief finite-element cell level stiffness matrix with first dimension traversing the cell id(in the order of macro-cell and subcell)
Expand Down Expand Up @@ -296,7 +296,7 @@ namespace dftfe{
#endif


#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/**
* @brief implementation of non-local Hamiltonian matrix-vector product using non-local discretized projectors at cell-level for complex data type
* @param src Vector containing current values of source array with multi-vector array stored
Expand Down
14 changes: 7 additions & 7 deletions include/force.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace dftfe {
*/
void printAtomsForces();

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/** @brief computes the configurational stress on the domain corresponding to
* affine deformation of the periodic cell.
*
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace dftfe {

void distributeForceContributionFPSPLocalGammaAtoms(const std::map<unsigned int, std::vector<double> > & forceContributionFPSPLocalGammaAtoms);

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
void FnlGammaAtomsElementalContributionPeriodic
(std::map<unsigned int, std::vector<double> > & forceContributionFnlGammaAtoms,
FEEvaluation<C_DIM,1,C_num1DQuad<FEOrder>(),C_DIM> & forceEval,
Expand Down Expand Up @@ -223,7 +223,7 @@ namespace dftfe {

void computeAtomsForcesGaussianGenerator(bool allowGaussianOverlapOnAtoms=false);

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
void computeStressEself();

void computeStressEEshelbyEPSPEnlEk();
Expand Down Expand Up @@ -254,15 +254,15 @@ namespace dftfe {
/// This vector doesn't contain contribution from terms which have sums over k points.
vectorType d_configForceVectorLinFE;

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/// Parallel distributed vector field which stores the configurational force for each fem node corresponding
/// to linear shape function generator (see equations 52-53 in (https://arxiv.org/abs/1712.05535)).
/// This vector only contains contribution from terms which have sums over k points.
vectorType d_configForceVectorLinFEKPoints;
#endif


#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/* Storage for precomputed nonlocal pseudopotential quadrature data. This is to speedup the
* configurational force computation. Data format: vector(numNonLocalAtomsCurrentProcess with
* non-zero compact support, vector(number pseudo wave functions,map<cellid,num_quad_points*2>)).
Expand Down Expand Up @@ -334,15 +334,15 @@ namespace dftfe {
/// Storage for configurational force on all global atoms.
std::vector<double> d_globalAtomsGaussianForces;

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
/* Part of the configurational force which is summed over k points.
* It is a temporary data structure required for force evaluation (d_globalAtomsGaussianForces)
* when parallization over k points is on.
*/
std::vector<double> d_globalAtomsGaussianForcesKPoints;
#endif

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX

/// Storage for configurational stress tensor
Tensor<2,C_DIM,double> d_stress;
Expand Down
2 changes: 1 addition & 1 deletion include/geoOptCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#ifndef geoOptCell_H_
#define geoOptCell_H_
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
#include "nonlinearSolverProblem.h"
#include "constants.h"

Expand Down
4 changes: 2 additions & 2 deletions include/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace dftfe{
* @param cellMap precomputed cell-local index id map of the multi-wavefunction field
* @param Y Vector containing multi-component fields after operator times vectors product
*/
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
virtual void HX(dealii::parallel::distributed::Vector<std::complex<double> > & X,
const unsigned int numberComponents,
const std::vector<std::vector<dealii::types::global_dof_index> > & macroCellMap,
Expand All @@ -112,7 +112,7 @@ namespace dftfe{
* @param X given orthogonal basis vectors
* @return ProjMatrix projected small matrix
*/
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
virtual void XtHX(std::vector<vectorType> & X,
std::vector<std::complex<double> > & ProjHam) = 0;
#else
Expand Down
32 changes: 16 additions & 16 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@ if [ $optimizedMode == 1 ]; then
# Control will enter here if build directory exists.
cd build
cd release
echo -e "${Blu}Building Non-Periodic executable in Optimized (Release) mode...${RCol}"
mkdir -p nonPeriodic && cd nonPeriodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Periodic executable in Optimized (Release) mode...${RCol}"
mkdir -p periodic && cd periodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
echo -e "${Blu}Building Double executable in Optimized (Release) mode...${RCol}"
mkdir -p double && cd double && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Complex executable in Optimized (Release) mode...${RCol}"
mkdir -p complex && cd complex && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
else
rm -rf build/release
echo -e "${Blu}Creating build directory...${RCol}"
mkdir -p build && cd build
mkdir -p release && cd release
echo -e "${Blu}Building Non-Periodic executable in Optimized (Release) mode...${RCol}"
mkdir -p nonPeriodic && cd nonPeriodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Periodic executable in Optimized (Release) mode...${RCol}"
mkdir -p periodic && cd periodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
echo -e "${Blu}Building Double executable in Optimized (Release) mode...${RCol}"
mkdir -p double && cd double && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Complex executable in Optimized (Release) mode...${RCol}"
mkdir -p complex && cd complex && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS_RELEASE="-O3" -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
fi
else
if [ -d "build/debug" ]; then
echo -e "${Blu}build/debug directory already present${RCol}"
# Control will enter here if build directory exists.
cd build
cd debug
echo -e "${Blu}Building Non-Periodic executable in Debug mode...${RCol}"
mkdir -p nonPeriodic && cd nonPeriodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Periodic executable in Debug mode...${RCol}"
mkdir -p periodic && cd periodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
echo -e "${Blu}Building Double executable in Debug mode...${RCol}"
mkdir -p double && cd double && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Complex executable in Debug mode...${RCol}"
mkdir -p complex && cd complex && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
else
rm -rf build/debug
echo -e "${Blu}Creating build directory...${RCol}"
mkdir -p build && cd build
mkdir -p debug && cd debug
echo -e "${Blu}Building Non-Periodic executable in Debug mode...${RCol}"
mkdir -p nonPeriodic && cd nonPeriodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Periodic executable in Debug mode...${RCol}"
mkdir -p periodic && cd periodic && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
echo -e "${Blu}Building Double executable in Debug mode...${RCol}"
mkdir -p double && cd double && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscRealDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ..
echo -e "${Blu}Building Complex executable in Debug mode...${RCol}"
mkdir -p complex && cd complex && cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_DIR=$dealiiPetscComplexDir -DALGLIB_DIR=$alglibDir -DLIBXC_DIR=$libxcDir -DSPGLIB_DIR=$spglibDir ../../../. && make -j 4 && cd ../..
fi
fi
echo -e "${Blu}Build complete.${RCol}"
8 changes: 4 additions & 4 deletions src/dft/density.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void dftClass<FEOrder>::compute_rhoOut()
std::fill(rhoTempSpinPolarized.begin(),rhoTempSpinPolarized.end(),0.0);
}

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::vector<Vector<double> > tempPsi(num_quad_points), tempPsi2(num_quad_points);
for (unsigned int q_point=0; q_point<num_quad_points; ++q_point)
{
Expand All @@ -90,7 +90,7 @@ void dftClass<FEOrder>::compute_rhoOut()
(*gradRhoOutValuesSpinPolarized)[cell->id()] = std::vector<double>(6*num_quad_points);
std::fill(gradRhoTempSpinPolarized.begin(),gradRhoTempSpinPolarized.end(),0.0);
}
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::vector<std::vector<Tensor<1,3,double> > > tempGradPsi(num_quad_points), tempGradPsi2(num_quad_points);
for(unsigned int q_point = 0; q_point < num_quad_points; ++q_point)
{
Expand Down Expand Up @@ -121,7 +121,7 @@ void dftClass<FEOrder>::compute_rhoOut()
//
factor=(eigenValues[kPoint][i+dftParameters::spinPolarized*numEigenValues]-fermiEnergy)/(C_kb*dftParameters::TVal);
double partialOccupancy2 = (factor >= 0)?std::exp(-factor)/(1.0 + std::exp(-factor)):1.0/(1.0 + std::exp(factor));
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if(dftParameters::spinPolarized==1)
{
rhoTempSpinPolarized[2*q_point] += partialOccupancy*d_kPointWeights[kPoint]*(tempPsi[q_point](0)*tempPsi[q_point](0) + tempPsi[q_point](1)*tempPsi[q_point](1));
Expand Down Expand Up @@ -229,7 +229,7 @@ void dftClass<FEOrder>::compute_rhoOut()
//
factor=(eigenValues[kPoint][i+dftParameters::spinPolarized*numEigenValues]-fermiEnergy)/(C_kb*dftParameters::TVal);
double partialOccupancy2 = (factor >= 0)?std::exp(-factor)/(1.0 + std::exp(-factor)):1.0/(1.0 + std::exp(factor));
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if(dftParameters::spinPolarized==1)
{
rhoTempSpinPolarized[2*q_point] += partialOccupancy*d_kPointWeights[kPoint]*(tempPsi[q_point](0)*tempPsi[q_point](0) + tempPsi[q_point](1)*tempPsi[q_point](1));
Expand Down
20 changes: 10 additions & 10 deletions src/dft/dft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace dftfe {
template<unsigned int FEOrder>
dftClass<FEOrder>::dftClass(const MPI_Comm &mpi_comm_replica,const MPI_Comm &_interpoolcomm):
FE (FE_Q<3>(QGaussLobatto<1>(FEOrder+1)), 1),
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
FEEigen (FE_Q<3>(QGaussLobatto<1>(FEOrder+1)), 2),
#else
FEEigen (FE_Q<3>(QGaussLobatto<1>(FEOrder+1)), 1),
Expand All @@ -99,7 +99,7 @@ namespace dftfe {
symmetryPtr= new symmetryClass<FEOrder>(this, mpi_comm_replica, _interpoolcomm);
geoOptIonPtr= new geoOptIon<FEOrder>(this, mpi_comm_replica);

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
geoOptCellPtr= new geoOptCell<FEOrder>(this, mpi_comm_replica);
#endif
}
Expand All @@ -111,7 +111,7 @@ namespace dftfe {
matrix_free_data.clear();
delete forcePtr;
delete geoOptIonPtr;
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
delete geoOptCellPtr;
#endif
}
Expand Down Expand Up @@ -235,7 +235,7 @@ namespace dftfe {
//estimate total number of wave functions
determineOrbitalFilling();

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
generateMPGrid();
#else
d_kPointCoordinates.resize(3,0.0);
Expand Down Expand Up @@ -316,7 +316,7 @@ namespace dftfe {

internaldft::convertToCellCenteredCartesianCoordinates(atomLocations,
d_domainBoundingVectors);
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
recomputeKPointCoordinates();
#endif
if (dftParameters::verbosity==2)
Expand Down Expand Up @@ -380,7 +380,7 @@ namespace dftfe {
//initialize dofHandlers and hanging-node constraints and periodic constraints on the unmoved Mesh
//
initUnmovedTriangulation(triangulationPar);
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if (dftParameters::useSymm)
symmetryPtr->initSymmetry() ;
#endif
Expand Down Expand Up @@ -463,7 +463,7 @@ namespace dftfe {
}
else if (!dftParameters::isIonOpt && dftParameters::isCellOpt)
{
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
geoOptCellPtr->init();
geoOptCellPtr->run();
#else
Expand All @@ -472,7 +472,7 @@ namespace dftfe {
}
else if (dftParameters::isIonOpt && dftParameters::isCellOpt)
{
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
//first relax ion positions in the starting cell configuration
geoOptIonPtr->init();
geoOptIonPtr->run();
Expand Down Expand Up @@ -830,7 +830,7 @@ namespace dftfe {

}
computing_timer.enter_section("compute rho");
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if(dftParameters::useSymm){
symmetryPtr->computeLocalrhoOut();
symmetryPtr->computeAndSymmetrize_rhoOut();
Expand Down Expand Up @@ -1002,7 +1002,7 @@ namespace dftfe {
forcePtr->printAtomsForces();
computing_timer.exit_section("ion force");
}
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if (dftParameters::isCellStress)
{
computing_timer.enter_section("cell stress");
Expand Down
8 changes: 4 additions & 4 deletions src/dft/electrostaticPRefinedEnergy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void dftClass<FEOrder>::computeElectrostaticEnergyPRefined()
dealii::ConstraintMatrix constraintsPRefined;
constraintsPRefined.reinit(locallyRelevantDofs);
dealii::DoFTools::make_hanging_node_constraints(dofHandlerPRefined, constraintsPRefined);
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::vector<std::vector<double> > unitVectorsXYZ;
unitVectorsXYZ.resize(3);

Expand Down Expand Up @@ -84,7 +84,7 @@ void dftClass<FEOrder>::computeElectrostaticEnergyPRefined()
dealii::ConstraintMatrix constraintsForTotalPotential;
constraintsForTotalPotential.reinit(locallyRelevantDofs);

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
locatePeriodicPinnedNodes(dofHandlerPRefined,
constraintsPRefined,
constraintsForTotalPotential);
Expand Down Expand Up @@ -154,7 +154,7 @@ void dftClass<FEOrder>::computeElectrostaticEnergyPRefined()
rhoOutPRefinedQuadValues[cellOld->id()] = std::vector<double>(num_quad_points);

fe_values.reinit (cellOld);
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
std::vector<dealii::Vector<double> > tempPsi(num_quad_points), tempPsi2(num_quad_points);
for (unsigned int q_point=0; q_point<num_quad_points; ++q_point)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ void dftClass<FEOrder>::computeElectrostaticEnergyPRefined()

for (unsigned int q_point=0; q_point<num_quad_points; ++q_point)
{
#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
if(dftParameters::spinPolarized==1)
{
const double temp1 = partialOccupancy*d_kPointWeights[kPoint]*(tempPsi[q_point](0)*tempPsi[q_point](0) + tempPsi[q_point](1)*tempPsi[q_point](1));
Expand Down
2 changes: 1 addition & 1 deletion src/dft/fermiEnergy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void dftClass<FEOrder>::compute_fermienergy()
double fe;
double R = 1.0;

#ifdef ENABLE_PERIODIC_BC
#ifdef USE_COMPLEX
//
//compute Fermi-energy first by bisection method
//
Expand Down
Loading

0 comments on commit b21434f

Please sign in to comment.