Skip to content

Commit

Permalink
modified defaults folder in src/ksdft and src/build
Browse files Browse the repository at this point in the history
  • Loading branch information
Avirup Sircar committed Sep 5, 2024
1 parent 241f29b commit 82b4907
Show file tree
Hide file tree
Showing 32 changed files with 603 additions and 287 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ meshSizeAroundAtom = 1
rc = 0.6
feOrderElectrostatics = 5
feOrderEigenSolve = 5
atomPartitionTolerance = 1e-14
smallestCellVolume = 1e-14
maxRecursion = 1000
adaptiveQuadAbsTolerance = 1e6
adaptiveQuadRelTolerance = 1e6
integralThreshold = 1e6
smearingTemperature = 500.
fermiEnergyTolerance = 1e-8
fracOccupancyTolerance = 1e-3
Expand All @@ -23,7 +29,6 @@ isAdaptiveAndersonMixingParameter = 0
evaluateEnergyEverySCF = 1
num1DGaussSizeVCorrecPlusPhi = 6
isNumericalNuclearSolve = 1
num1DGaussSizeSmearNucl = 6
gridSizeFD = 0.001
numDimPerturbed = 1
numAtomPerturbed = 1
dimIdPerturbed = 2
atomIdPerturbed = 0
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ int main(int argc, char** argv)
double fermiEnergyTolerance = readParameter<double>(parameterInputFileName, "fermiEnergyTolerance", rootCout);
double fracOccupancyTolerance = readParameter<double>(parameterInputFileName, "fracOccupancyTolerance", rootCout);
double eigenSolveResidualTolerance = readParameter<double>(parameterInputFileName, "eigenSolveResidualTolerance", rootCout);
size_type chebyshevPolynomialDegree = readParameter<size_type>(parameterInputFileName, "chebyshevPolynomialDegree", rootCout);
size_type maxChebyshevFilterPass = readParameter<size_type>(parameterInputFileName, "maxChebyshevFilterPass", rootCout);
size_type numWantedEigenvalues = readParameter<size_type>(parameterInputFileName, "numWantedEigenvalues", rootCout);
double scfDensityResidualNormTolerance = readParameter<double>(parameterInputFileName, "scfDensityResidualNormTolerance", rootCout);
Expand All @@ -401,9 +400,10 @@ int main(int argc, char** argv)
double integralThreshold = readParameter<double>(parameterInputFileName, "integralThreshold", rootCout);

double gridSizeFD = readParameter<double>(parameterInputFileName, "gridSizeFD", rootCout);
unsigned int numDimPerturbed = readParameter<unsigned int>(parameterInputFileName, "numDimPerturbed", rootCout);
unsigned int numAtomPerturbed = readParameter<unsigned int>(parameterInputFileName, "numAtomPerturbed", rootCout);

unsigned int dimIdPerturbed = readParameter<unsigned int>(parameterInputFileName, "dimIdPerturbed", rootCout);
unsigned int atomIdPerturbed = readParameter<unsigned int>(parameterInputFileName, "atomIdPerturbed", rootCout);
size_type numDimPerturbed = 1;
size_type numAtomPerturbed = 1;
bool isNumericalNuclearSolve = readParameter<bool>(parameterInputFileName, "isNumericalNuclearSolve", rootCout);

// Set up Triangulation
Expand Down Expand Up @@ -473,7 +473,7 @@ int main(int argc, char** argv)
{
for (unsigned int iDim = 0 ; iDim < dim ; iDim ++)
{
if(atomId == perturbAtomId && iDim == perturbDim)
if(atomId == atomIdPerturbed && iDim == dimIdPerturbed)
coordinatesVec[atomId][iDim] = atomCoordinatesVec[atomId][iDim] + gridPt*gridSizeFD;
else
coordinatesVec[atomId][iDim] = atomCoordinatesVec[atomId][iDim];
Expand Down Expand Up @@ -949,7 +949,7 @@ int main(int argc, char** argv)
*cfeBasisDataStorageAdaptiveOrbital,
*efeBasisDataAdaptiveOrbital,
*cfeBasisDataStorageAdaptiveOrbital,
50,
numWantedEigenvalues * ksdft::KSDFTDefaults::CELL_BATCH_SIZE,
true);

// // add device synchronize for gpu
Expand Down Expand Up @@ -984,7 +984,7 @@ int main(int argc, char** argv)
// *cfeBasisDataStorageGaussEigen,
// *efeBasisDataAdaptiveOrbital,
// /**cfeBasisDataStorageGLLEigen,*/
// 50);
// numWantedEigenvalues * ksdft::KSDFTDefaults::CELL_BATCH_SIZE);

std::shared_ptr<const basis::OrthoEFEOverlapOperatorContext<double,
double,
Expand Down Expand Up @@ -1020,10 +1020,10 @@ int main(int argc, char** argv)
Host,
dim>>
(*basisManagerWaveFn,
*MContext,
/**cfeBasisDataStorageGLLEigen,
/**MContext,*/
*cfeBasisDataStorageGLLEigen,
*efeBasisDataAdaptiveOrbital,
*cfeBasisDataStorageGLLEigen,*/
*cfeBasisDataStorageGLLEigen,
linAlgOpContext);

// add device synchronize for gpu
Expand Down Expand Up @@ -1133,7 +1133,6 @@ int main(int argc, char** argv)
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -1152,8 +1151,6 @@ int main(int argc, char** argv)
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
*MContext,
/**MContextForInv,*/
Expand Down Expand Up @@ -1199,7 +1196,6 @@ int main(int argc, char** argv)
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -1216,8 +1212,6 @@ int main(int argc, char** argv)
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
*MContext,
/**MContextForInv,*/
Expand Down Expand Up @@ -1248,8 +1242,8 @@ int main(int argc, char** argv)
for(unsigned int perturbAtomId = 0 ; perturbAtomId < numAtomPerturbed ; perturbAtomId++ )
{
unsigned int index = (numAtomPerturbed*perturbDim + perturbAtomId)*4;
rootCout << "The energies calculated by perturbation to atom "<< perturbAtomId <<
" along Dim " << perturbDim <<" are: "<< energyInPerturbIds[index] << ", "<<energyInPerturbIds[index+1]
rootCout << "The energies calculated by perturbation to atom "<< atomIdPerturbed <<
" along Dim " << dimIdPerturbed <<" are: "<< energyInPerturbIds[index] << ", "<<energyInPerturbIds[index+1]
<<", "<<energyInPerturbIds[index+2]<<", "<<energyInPerturbIds[index+3]<<"\n";
force[count] = (-energyInPerturbIds[index] + 8*energyInPerturbIds[index+1] -
8*energyInPerturbIds[index+2] + energyInPerturbIds[index+3])/(12*gridSizeFD);
Expand All @@ -1262,8 +1256,8 @@ int main(int argc, char** argv)
for(unsigned int perturbAtomId = 0 ; perturbAtomId < numAtomPerturbed ; perturbAtomId++ )
{
unsigned int index = (numAtomPerturbed*perturbDim + perturbAtomId);
rootCout << "The force calculated by perturbation to atom "<< perturbAtomId <<
" along Dim " << perturbDim <<" is: "<< force[numAtomPerturbed*perturbDim + perturbAtomId]<<"\n";
rootCout << "The force calculated by perturbation to atom "<< atomIdPerturbed <<
" along Dim " << dimIdPerturbed <<" is: "<< force[numAtomPerturbed*perturbDim + perturbAtomId]<<"\n";
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
xmax = 26.001
ymax = 26.001
zmax = 26.001
xmax = 30
ymax = 30
zmax = 30
radiusAtAtom = 0
meshSizeAtAtom = 2.8
radiusAroundAtom = 4
meshSizeAroundAtom = 2.8
meshSizeAtAtom = 0.1
radiusAroundAtom = 2
meshSizeAroundAtom = 0.5
rc = 0.6
feOrderElectrostatics = 6
feOrderEigenSolve = 2
feOrderElectrostatics = 5
feOrderEigenSolve = 4
atomPartitionTolerance = 1e-14
smallestCellVolume = 1e-14
maxRecursion = 100
adaptiveQuadAbsTolerance = 1e-3
adaptiveQuadRelTolerance = 1e-3
integralThreshold = 1e-3
adaptiveQuadAbsTolerance = 1e-6
adaptiveQuadRelTolerance = 1e-6
integralThreshold = 1e-6
smearingTemperature = 500.
fermiEnergyTolerance = 1e-8
fracOccupancyTolerance = 1e-3
eigenSolveResidualTolerance = 1e-3
chebyshevPolynomialDegree = 20
maxChebyshevFilterPass = 40
chebyshevPolynomialDegree = 500
maxChebyshevFilterPass = 20
numWantedEigenvalues = 20
scfDensityResidualNormTolerance = 1e-5
maxSCFIter = 80
Expand All @@ -29,5 +29,5 @@ isAdaptiveAndersonMixingParameter = 0
evaluateEnergyEverySCF = 1
isNumericalNuclearSolve = 0
gridSizeFD = 0.001
numDimPerturbed = 1
numAtomPerturbed = 1
dimIdPerturbed = 2
atomIdPerturbed = 0
8 changes: 4 additions & 4 deletions analysis/classicalEnrichmentComparison/H.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ int main(int argc, char** argv)
double fermiEnergyTolerance = readParameter<double>(parameterInputFileName, "fermiEnergyTolerance", rootCout);
double fracOccupancyTolerance = readParameter<double>(parameterInputFileName, "fracOccupancyTolerance", rootCout);
double eigenSolveResidualTolerance = readParameter<double>(parameterInputFileName, "eigenSolveResidualTolerance", rootCout);
size_type chebyshevPolynomialDegree = readParameter<size_type>(parameterInputFileName, "chebyshevPolynomialDegree", rootCout);
size_type maxChebyshevFilterPass = readParameter<size_type>(parameterInputFileName, "maxChebyshevFilterPass", rootCout);
size_type numWantedEigenvalues = readParameter<size_type>(parameterInputFileName, "numWantedEigenvalues", rootCout);
double scfDensityResidualNormTolerance = readParameter<double>(parameterInputFileName, "scfDensityResidualNormTolerance", rootCout);
Expand Down Expand Up @@ -644,7 +643,7 @@ std::shared_ptr<linearAlgebra::OperatorContext<double,
dim>>(
*basisManagerWaveFn,
*feBDElectrostaticsHamiltonian,
50);
numWantedEigenvalues * ksdft::KSDFTDefaults::CELL_BATCH_SIZE);

std::shared_ptr<basis::FEBasisDataStorage<double, Host>> feBDTotalChargeRhs =
std::make_shared<basis::CFEBasisDataStorageDealii<double, double, Host,dim>>
Expand Down Expand Up @@ -710,7 +709,6 @@ std::shared_ptr<linearAlgebra::OperatorContext<double,
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -729,9 +727,8 @@ std::shared_ptr<linearAlgebra::OperatorContext<double,
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
/**MContextForInv,*/
*MContext,
*MInvContext);

Expand Down Expand Up @@ -761,7 +758,6 @@ std::shared_ptr<linearAlgebra::OperatorContext<double,
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -778,9 +774,8 @@ std::shared_ptr<linearAlgebra::OperatorContext<double,
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
/**MContextForInv,*/
*MContext,
*MInvContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ int main(int argc, char** argv)
double fermiEnergyTolerance = readParameter<double>(parameterInputFileName, "fermiEnergyTolerance", rootCout);
double fracOccupancyTolerance = readParameter<double>(parameterInputFileName, "fracOccupancyTolerance", rootCout);
double eigenSolveResidualTolerance = readParameter<double>(parameterInputFileName, "eigenSolveResidualTolerance", rootCout);
size_type chebyshevPolynomialDegree = readParameter<size_type>(parameterInputFileName, "chebyshevPolynomialDegree", rootCout);
size_type maxChebyshevFilterPass = readParameter<size_type>(parameterInputFileName, "maxChebyshevFilterPass", rootCout);
size_type numWantedEigenvalues = readParameter<size_type>(parameterInputFileName, "numWantedEigenvalues", rootCout);
double scfDensityResidualNormTolerance = readParameter<double>(parameterInputFileName, "scfDensityResidualNormTolerance", rootCout);
Expand Down Expand Up @@ -947,7 +946,7 @@ int main(int argc, char** argv)
*cfeBasisDataStorageAdaptiveOrbital,
*efeBasisDataAdaptiveOrbital,
*cfeBasisDataStorageAdaptiveOrbital,
50,
numWantedEigenvalues * ksdft::KSDFTDefaults::CELL_BATCH_SIZE,
true);

// // add device synchronize for gpu
Expand Down Expand Up @@ -982,7 +981,7 @@ int main(int argc, char** argv)
// *cfeBasisDataStorageGaussEigen,
// *efeBasisDataAdaptiveOrbital,
// /**cfeBasisDataStorageGLLEigen,*/
// 50);
// numWantedEigenvalues * ksdft::KSDFTDefaults::CELL_BATCH_SIZE,);

std::shared_ptr<const basis::OrthoEFEOverlapOperatorContext<double,
double,
Expand Down Expand Up @@ -1096,7 +1095,6 @@ int main(int argc, char** argv)
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -1115,8 +1113,6 @@ int main(int argc, char** argv)
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
*MContext,
/**MContextForInv,*/
Expand Down Expand Up @@ -1161,7 +1157,6 @@ int main(int argc, char** argv)
fracOccupancyTolerance,
eigenSolveResidualTolerance,
scfDensityResidualNormTolerance,
chebyshevPolynomialDegree,
maxChebyshevFilterPass,
maxSCFIter,
evaluateEnergyEverySCF,
Expand All @@ -1178,8 +1173,6 @@ int main(int argc, char** argv)
feBDEXCHamiltonian,
*externalPotentialFunction,
linAlgOpContext,
50,
50,
*MContextForInv,
*MContext,
/**MContextForInv,*/
Expand Down
16 changes: 8 additions & 8 deletions analysis/classicalEnrichmentComparison/Li.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions analysis/classicalEnrichmentComparison/O.xml

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions analysis/classicalEnrichmentComparison/Si.xml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions analysis/classicalEnrichmentComparison/Si_Cluster.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Si 14 -5.13 -5.13 -5.13
Si 14 -5.13 -5.13 5.13
Si 14 -5.13 5.13 -5.13
Si 14 -5.13 5.13 5.13
Si 14 5.13 -5.13 -5.13
Si 14 5.13 -5.13 5.13
Si 14 5.13 5.13 -5.13
Si 14 5.13 5.13 5.13
Si 14 -5.13 0 0
Si 14 5.13 0 0
Si 14 0 -5.13 0
Si 14 0 5.13 0
Si 14 0 0 -5.13
Si 14 0 0 5.13
Si 14 2.565 2.565 2.565
Si 14 2.565 -2.565 -2.565
Si 14 -2.565 2.565 -2.565
Si 14 -2.565 -2.565 2.565
5 changes: 4 additions & 1 deletion src/basis/CFEOverlapInverseOpContextGLL.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@
#include <utils/MemorySpaceType.h>
#include <linearAlgebra/LinearAlgebraTypes.h>
#include <linearAlgebra/OperatorContext.h>
#include <linearAlgebra/CGLinearSolver.h>
#include <linearAlgebra/LinearAlgebraTypes.h>
#include <linearAlgebra/LinearSolverFunction.h>
#include <linearAlgebra/PreconditionerNone.h>
#include <basis/FEBasisManager.h>
#include <basis/FEBasisDataStorage.h>
#include <basis/CFEOverlapOperatorContext.h>
#include <quadrature/QuadratureAttributes.h>
#include <basis/FECellWiseDataOperations.h>
#include <vector>
#include <memory>
#include <basis/EnrichmentClassicalInterfaceSpherical.h>

namespace dftefe
{
Expand Down
2 changes: 1 addition & 1 deletion src/basis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ set(DFT-EFE-BASIS-SOURCES
CFEOverlapOperatorContext.cpp
PristineEFEOverlapOperatorContext.cpp
OrthoEFEOverlapOperatorContext.cpp
EnrichmentClassicalInterfaceSpherical.cpp
L2ProjectionLinearSolverFunction.cpp
Defaults.cpp
CFEOverlapInverseOpContextGLL.cpp
EnrichmentClassicalInterfaceSpherical.cpp
OrthoEFEOverlapInverseOpContextGLL.cpp
EFEBasisDataStorageDealii.cpp
EFEBasisDofHandlerDealii.cpp
Expand Down
Loading

0 comments on commit 82b4907

Please sign in to comment.