forked from QMCPACK/qmcpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request QMCPACK#4859 from PDoakORNL/consistent_precision_i…
…nputsection Make InputSection full precision only.
- Loading branch information
Showing
11 changed files
with
68 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2022 QMCPACK developers. | ||
// Copyright (c) 2023 QMCPACK developers. | ||
// | ||
// File developed by: Jaron T. Krogel, [email protected], Oak Ridge National Laboratory | ||
// Peter W. Doak, [email protected], Oak Ridge National Laboratory | ||
|
@@ -49,7 +49,6 @@ void InputSection::readAttributes(xmlNodePtr cur, | |
setFromStreamCustom(element_name, qualified_name, stream); | ||
else | ||
setFromStream(qualified_name, stream); | ||
|
||
att = att->next; | ||
} | ||
} | ||
|
@@ -65,6 +64,7 @@ void InputSection::handleDelegate(const std::string& ename, const xmlNodePtr ele | |
|
||
void InputSection::readXML(xmlNodePtr cur) | ||
{ | ||
assert(cur != nullptr); | ||
// For historical reasons that actual "type" of the element/input section is expressed in a very inconsistent way. | ||
// It could be coded via the element name i.e. the tag, or at minimum a method, type, or name attribute. | ||
std::string section_ename{lowerCase(castXMLCharToChar(cur->name))}; | ||
|
@@ -200,7 +200,7 @@ void InputSection::setFromStream(const std::string& name, std::istringstream& sv | |
else if (isMultiReal(name)) | ||
{ | ||
std::vector<Real> real_values; | ||
for (FullPrecReal value; svalue >> value;) | ||
for (Real value; svalue >> value;) | ||
real_values.push_back(static_cast<Real>(value)); | ||
assignValue(name, real_values); | ||
} | ||
|
@@ -219,7 +219,7 @@ void InputSection::setFromStream(const std::string& name, std::istringstream& sv | |
} | ||
else if (isReal(name)) | ||
{ | ||
FullPrecReal value; | ||
Real value; | ||
svalue >> value; | ||
assignValue(name, Real(value)); | ||
} | ||
|
@@ -249,7 +249,7 @@ void InputSection::assignValue(const std::string& name, const T& value) | |
else | ||
{ | ||
if (has(name)) | ||
std::any_cast<std::vector<T>>(values_[name]).push_back(value); | ||
std::any_cast<std::vector<T>&>(values_[name]).push_back(value); | ||
else | ||
values_[name] = std::vector<T>{value}; | ||
} | ||
|
@@ -318,6 +318,11 @@ void InputSection::report(std::ostream& out) const | |
out << "\n\n"; | ||
} | ||
|
||
void InputSection::report() const | ||
{ | ||
report(app_log()); | ||
} | ||
|
||
std::any InputSection::lookupAnyEnum(const std::string& enum_name, | ||
const std::string& enum_value, | ||
const std::unordered_map<std::string, std::any>& enum_map) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2021 QMCPACK developers. | ||
// Copyright (c) 2023 QMCPACK developers. | ||
// | ||
// File developed by: Jaron T. Krogel, [email protected], Oak Ridge National Laboratory | ||
// | ||
|
@@ -24,7 +24,7 @@ class MomentumDistributionInput | |
{ | ||
public: | ||
using Consumer = MomentumDistribution; | ||
using Real = QMCTraits::RealType; | ||
using Real = QMCTraits::FullPrecRealType; | ||
|
||
class MomentumDistributionInputSection : public InputSection | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2021 QMCPACK developers. | ||
// Copyright (c) 2023 QMCPACK developers. | ||
// | ||
// File developed by: Peter Doak, [email protected], Oak Ridge National Laboratory | ||
// | ||
|
@@ -16,6 +16,9 @@ | |
namespace qmcplusplus | ||
{ | ||
|
||
template bool InputSection::setIfInInput<qmcplusplus::OneBodyDensityMatricesInput::Integrator>(qmcplusplus::OneBodyDensityMatricesInput::Integrator& var, const std::string& tag); | ||
|
||
|
||
OneBodyDensityMatricesInput::OneBodyDensityMatricesInput(xmlNodePtr cur) | ||
{ | ||
// This results in checkParticularValidity being called on OneBodyDensityMatrixInputSection | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2022 QMCPACK developers. | ||
// Copyright (c) 2023 QMCPACK developers. | ||
// | ||
// File developed by: Jaron T. Krogel, [email protected], Oak Ridge National Laboratory | ||
// Mark A. Berrill, [email protected], Oak Ridge National Laboratory | ||
|
@@ -20,6 +20,8 @@ | |
|
||
namespace qmcplusplus | ||
{ | ||
template bool InputSection::setIfInInput<ReferencePointsInput::Coord>(ReferencePointsInput::Coord& var, | ||
const std::string& tag); | ||
|
||
ReferencePointsInput::ReferencePointsInput(xmlNodePtr cur) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters