Skip to content

Commit

Permalink
MGmol<OrbitalsType>::loadOrbitalFromRestartFile tested with Carbyne e…
Browse files Browse the repository at this point in the history
…xample.
  • Loading branch information
dreamer2368 committed Apr 19, 2024
1 parent ce80bfe commit 72242f7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/Carbyne/carbyne.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ atol=1.e-8
[Orbitals]
initial_type=Fourier
[Restart]
output_level=3
output_level=4
31 changes: 31 additions & 0 deletions examples/Carbyne/carbyne.rom.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
verbosity=2
xcFunctional=PBE
FDtype=4th
[Mesh]
nx= 96
ny= 96
nz= 192
[Domain]
ox= -10.
oy= -10.
oz= -20.
lx= 20.
ly= 20.
lz= 40.
[Potentials]
pseudopotential=pseudo.H_ONCV_PBE_SG15
pseudopotential=pseudo.C_ONCV_PBE_SG15
[Run]
type=QUENCH
[Quench]
max_steps=10
atol=1.e-8
[Orbitals]
initial_type=Fourier
[Restart]
output_level=4
# input_level=4
# input_filename=snapshot0_24_109_22_36

[ROM.offline]
restartFilename=snapshot0_24_109_22_39
6 changes: 3 additions & 3 deletions src/MGmol.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ class MGmol : public MGmolInterface
int dumprestartFile(OrbitalsType** orbitals, Ions& ions,
Rho<OrbitalsType>& rho, const bool write_extrapolated_wf,
const short count);
#ifdef MGMOL_HAS_LIBROM
int save_orbital_snapshot(std::string snapshot_dir, OrbitalsType& orbitals);
#endif

void swapColumnsVect(dist_matrix::DistMatrix<DISTMATDTYPE>& evect,
const dist_matrix::DistMatrix<DISTMATDTYPE>& hb2N,
Expand Down Expand Up @@ -308,6 +305,9 @@ class MGmol : public MGmolInterface
}

OrbitalsType* loadOrbitalFromRestartFile(const std::string filename);
#ifdef MGMOL_HAS_LIBROM
int save_orbital_snapshot(std::string snapshot_dir, OrbitalsType& orbitals);
#endif
};
// Instantiate static variables here to avoid clang warnings
template <class OrbitalsType>
Expand Down
3 changes: 3 additions & 0 deletions src/rom_workflows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ void readRestartFiles(MGmolInterface *mgmol_)
MGmol<OrbitalsType> *mgmol = static_cast<MGmol<OrbitalsType> *>(mgmol_);

OrbitalsType *orbitals = mgmol->loadOrbitalFromRestartFile(rom_options.restart_filename);

mgmol->save_orbital_snapshot("test", *orbitals);

delete orbitals;
}

Expand Down

0 comments on commit 72242f7

Please sign in to comment.