File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1657,18 +1657,26 @@ void SphericalBasis::determine_acceleration_and_potential(void)
16571657
16581658 // This should suffice for both CPU and GPU
16591659 if (FIX_L0) {
1660- // Save the monopole coefficients on the first evaluation
1660+ // Save the monopole coefficients on the first evaluation or read
1661+ // from the restart cache
16611662 if (C0.size () == 0 ) {
16621663 bool okay = true ;
16631664 // Attempt to read backup coefficients from file
16641665 if (restart) {
16651666 read_FIXL0_restart_data ();
1667+ // No coefficients read from file??
1668+ if (C0.size () == 0 ) {
1669+ if (myid==0 ) {
1670+ std::cout << " ---- SphericalBasis: WARNING: could not read FIX_L0"
1671+ << " restart data from file!" << endl;
1672+ throw std::runtime_error (" SphericalBasis: FIX_L0 restart read error" );
1673+ }
1674+ }
16661675 }
1667- // If not read from file on restart, save current coefficients
1668- if (C0.size () == 0 ) {
1669- C0 = *expcoef[0 ];
1670- write_FIXL0_restart_data ();
1671- }
1676+ // If not read from file on restart, cache the current
1677+ // coefficients
1678+ C0 = *expcoef[0 ];
1679+ write_FIXL0_restart_data ();
16721680 }
16731681 // Copy the saved coefficients to the active array
16741682 else *expcoef[0 ] = C0;
You can’t perform that action at this time.
0 commit comments