Skip to content

Commit

Permalink
Made some changes to make the code compatible with dealii8.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phanimotamarri committed Jul 30, 2017
1 parent 02805e7 commit dc5357e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
##Note: Set ALGLIB, LIBXC, PETSC and SLEPC paths below.

##set ALGLIB paths
SET(ALGLIB_INCLUDE "/nfs/mcfs_comp/home/rudraa/software/alglib/cpp/src/") #path to interpolation.h
SET(ALGLIB_LIB "/nfs/mcfs_comp/home/rudraa/software/alglib/cpp/src/libAlglib.so") #path to libAlglib.so
SET(ALGLIB_INCLUDE "/home/phanim/softwares/alglib/cpp/src/") #path to interpolation.h
SET(ALGLIB_LIB "/home/phanim/softwares/alglib/cpp/src/libAlglib.so") #path to libAlglib.so
##Note: On some platforms, you may have to set DYLD_LIBRARY_PATH(OSX)/LD_LIBRARY_PATH to include path ALGLIB_LIB. For example:
##export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/Algib/.so/file

##set LIBXC paths
SET(LIBXC_INCLUDE "/nfs/mcfs_comp/home/rudraa/software/libxc/libxc-2.2.0/installDir/include") #path to xc.h
SET(LIBXC_LIB "/nfs/mcfs_comp/home/rudraa/software/libxc/libxc-2.2.0/installDir/lib/libxc.a") #path to libxc.a
SET(LIBXC_INCLUDE "/home/phanim/softwares/libxc/install_caen_libxc/include") #path to xc.h
SET(LIBXC_LIB "/home/phanim/softwares/libxc/install_caen_libxc/lib/libxc.a") #path to libxc.a

##set PETSc Real paths
SET(PETSC_REAL_INCLUDE "/home/vikramg/DFT-FE-softwares/softwareCentos/petsc/intel_petsc3.7.5_double_elemental/include")
SET(PETSC_REAL_LIB "/home/vikramg/DFT-FE-softwares/softwareCentos/petsc/intel_petsc3.7.5_double_elemental/lib/libpetsc.so")
SET(PETSC_REAL_INCLUDE "/home/phanim/softwares/PETSc/install_caen_double/include")
SET(PETSC_REAL_LIB "/home/phanim/softwares/PETSc/install_caen_double/lib/libpetsc.so")

##set SLEPc Real paths
SET(SLEPC_REAL_INCLUDE "/home/vikramg/DFT-FE-softwares/softwareCentos/slepc/intel_slepc3.7.3_double_elemental/include")
SET(SLEPC_REAL_LIB "/home/vikramg/DFT-FE-softwares/softwareCentos/slepc/intel_slepc3.7.3_double_elemental/lib/libslepc.so")
SET(SLEPC_REAL_INCLUDE "/home/phanim/softwares/SLEPc/install_caen_double/include")
SET(SLEPC_REAL_LIB "/home/phanim/softwares/SLEPc/install_caen_double/lib/libslepc.so")

##set PETSc Complex paths
SET(PETSC_COMPLEX_INCLUDE "/home/vikramg/DFT-FE-softwares/softwareCentos/petsc/intel_petsc3.7.5_complex/include")
SET(PETSC_COMPLEX_LIB "/home/vikramg/DFT-FE-softwares/softwareCentos/petsc/intel_petsc3.7.5_complex/lib/libpetsc.so")
SET(PETSC_COMPLEX_INCLUDE "/home/phanim/softwares/PETSc/install_caen_complex/include")
SET(PETSC_COMPLEX_LIB "/home/phanim/softwares/PETSc/install_caen_complex/lib/libpetsc.so")

##set SLEPc Complex paths
SET(SLEPC_COMPLEX_INCLUDE "/home/vikramg/DFT-FE-softwares/softwareCentos/slepc/intel_slepc3.7.3_complex/include")
SET(SLEPC_COMPLEX_LIB "/home/vikramg/DFT-FE-softwares/softwareCentos/slepc/intel_slepc3.7.3_complex/lib/libslepc.so")
SET(SLEPC_COMPLEX_INCLUDE "/home/phanim/softwares/SLEPc/install_caen_complex/include")
SET(SLEPC_COMPLEX_LIB "/home/phanim/softwares/SLEPc/install_caen_complex/lib/libslepc.so")

#
# Usually, you will not need to modify anything beyond this point...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#path specifying the location of the "build" directory which is usually the location of "src" folder
#
set DFT PATH = "/home/phanim/KohnShamCodes/DEALIICode/dft-fe"
set DFT PATH = "/home/phanim/DFT-FE/dft-fe"

#
#finite-element related parameters
Expand Down
1 change: 1 addition & 0 deletions include/headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_q1.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -o pipefail
#script to setup and build DFT-FE
#set CMAKE path
cmake=/sw/arcts/centos7/cmake/3.5.2/bin/cmake
cmake=/usr/bin/cmake
#
#Usually, no changes are needed below this line
#
Expand Down
6 changes: 3 additions & 3 deletions src/dft/initPseudo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void dftClass<FEOrder>::initLocalPseudoPotential()
double *pseudoValuesPtr = &((*pseudoValues)[cell->id()][0]);
for (unsigned int q = 0; q < n_q_points; ++q)
{
MappingQ<3> test(1);
MappingQ1<3,3> test;
Point<3> quadPoint(test.transform_unit_to_real_cell(cell, fe_values.get_quadrature().point(q)));
double pseudoValueAtQuadPt=0.0;
//loop over atoms
Expand Down Expand Up @@ -782,7 +782,7 @@ void dftClass<FEOrder>::computeSparseStructureNonLocalProjectors()
const int globalSplineId = d_deltaVlIdToFunctionIdDetails[pseudoPotentialId][0];
for(int iQuadPoint = 0; iQuadPoint < numberQuadraturePoints; ++iQuadPoint)
{
MappingQ<3> test(1);
MappingQ1<3,3> test;
Point<3> quadPoint(test.transform_unit_to_real_cell(cell, fe_values.get_quadrature().point(iQuadPoint)));

for(int iImageAtomCount = 0; iImageAtomCount < imageIdsList.size(); ++iImageAtomCount)
Expand Down Expand Up @@ -1003,7 +1003,7 @@ void dftClass<FEOrder>::computeElementalProjectorKets()
for(int iQuadPoint = 0; iQuadPoint < numberQuadraturePoints; ++iQuadPoint)
{

MappingQ<3> test(1);
MappingQ1<3,3> test;
Point<3> quadPoint(test.transform_unit_to_real_cell(cell, fe_values.get_quadrature().point(iQuadPoint)));

for(int iImageAtomCount = 0; iImageAtomCount < imageIdsList.size(); ++iImageAtomCount)
Expand Down
4 changes: 2 additions & 2 deletions src/dft/initRho.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void dftClass<FEOrder>::initRho()
double *rhoInValuesPtr = &((*rhoInValues)[cell->id()][0]);
for (unsigned int q = 0; q < n_q_points; ++q)
{
MappingQ<3> test(1);
MappingQ1<3,3> test;
Point<3> quadPoint(test.transform_unit_to_real_cell(cell, fe_values.get_quadrature().point(q)));
double rhoValueAtQuadPt = 0.0;

Expand Down Expand Up @@ -130,7 +130,7 @@ void dftClass<FEOrder>::initRho()

for (unsigned int q = 0; q < n_q_points; ++q)
{
MappingQ<3> test(1);
MappingQ1<3,3> test;
Point<3> quadPoint(test.transform_unit_to_real_cell(cell, fe_values.get_quadrature().point(q)));
double gradRhoXValueAtQuadPt = 0.0;
double gradRhoYValueAtQuadPt = 0.0;
Expand Down
10 changes: 8 additions & 2 deletions src/poisson/poisson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,18 @@ void poissonClass<FEOrder>::computeRHS2()
}
rhs2.compress(VectorOperation::add);
jacobianDiagonal.compress(VectorOperation::add);

//remove zero entries of the jacobianDiagonal which occur at the hanging nodes
for (unsigned int i=0; i<jacobianDiagonal.local_size(); i++)
{
if (std::abs(jacobianDiagonal.local_element(i))<1.0e-15)
{
jacobianDiagonal.local_element(i)=1.0;
}
else
{
jacobianDiagonal.local_element(i) = 1.0/jacobianDiagonal.local_element(i);
}
}
jacobianDiagonal.update_ghost_values();
//pcout << "rhs2: " << rhs2.l2_norm() << std::endl;
Expand Down Expand Up @@ -233,7 +238,7 @@ void poissonClass<FEOrder>::computeRHS(std::map<dealii::CellId,std::vector<doubl
if(!constraintMatrix->is_identity_constrained(i))
{
if(rhoValues) rhs(i)=0.0;
else rhs(i)=constraintMatrix->get_inhomogeneity(i)*jacobianDiagonal(i);
else rhs(i)=constraintMatrix->get_inhomogeneity(i)/jacobianDiagonal(i);
}
}
}
Expand Down Expand Up @@ -346,7 +351,8 @@ void poissonClass<FEOrder>::vmult(vectorType &dst, const vectorType &src) const
template<unsigned int FEOrder>
void poissonClass<FEOrder>::precondition_Jacobi(vectorType& dst, const vectorType& src, const double omega) const
{
dst.ratio(src, jacobianDiagonal);
dst = src;
dst.scale(jacobianDiagonal);
}

//
Expand Down

0 comments on commit dc5357e

Please sign in to comment.