Skip to content

Commit 47e0af6

Browse files
authored
Merge pull request #11 from prisms-center/2.0a3
Merge 2.0a3
2 parents 59cb631 + c17d637 commit 47e0af6

16 files changed

+678
-28
lines changed

.github/workflows/test-linux-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache/restore@v3
4141
with:
4242
path: CASMcode_crystallography/dist
43-
key: ${{ runner.os }}-libcasm-xtal-v2-0a2
43+
key: ${{ runner.os }}-libcasm-xtal-v2-0a5
4444

4545
- name: Install CASM dependencies
4646
run: |

.github/workflows/test-linux-cxx-only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache/restore@v3
4141
with:
4242
path: CASMcode_crystallography/dist
43-
key: ${{ runner.os }}-libcasm-xtal-v2-0a2
43+
key: ${{ runner.os }}-libcasm-xtal-v2-0a5
4444

4545
- name: Install CASM dependencies
4646
run: |

.github/workflows/test-linux-dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ jobs:
5858
uses: actions/cache/restore@v3
5959
with:
6060
path: CASMcode_crystallography/dist
61-
key: ${{ runner.os }}-libcasm-xtal-v2-0a2
61+
key: ${{ runner.os }}-libcasm-xtal-v2-0a5
6262

6363
- name: checkout libcasm-xtal
6464
if: steps.cache-libcasm-xtal-restore.outputs.cache-hit != 'true'
6565
uses: actions/checkout@v3
6666
with:
6767
repository: prisms-center/CASMcode_crystallography
6868
path: CASMcode_crystallography
69-
ref: v2.0a2
69+
ref: v2.0a5
7070

7171
- name: make xtal
7272
if: steps.cache-libcasm-xtal-restore.outputs.cache-hit != 'true'

.github/workflows/test-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache/restore@v3
4141
with:
4242
path: CASMcode_crystallography/dist
43-
key: ${{ runner.os }}-libcasm-xtal-v2-0a2
43+
key: ${{ runner.os }}-libcasm-xtal-v2-0a5
4444

4545
- name: Install CASM dependencies
4646
run: |

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to `libcasm-clexulator` will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0a3] - 2023-10-25
9+
10+
### Fixed
11+
12+
- Fixed error messages for conversion of local DoF to the standard basis
13+
- Fixed DiffClexParamPack traits namespace
14+
15+
### Added
16+
17+
- Tests for correct treatment of local DoF basis with dim=0 on some sublattices
18+
819

920
## [2.0a2] - 2023-09-28
1021

build_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cmake>=3.20
55
ninja
66
pybind11>=2.6
77
libcasm-global>=2.0.2
8-
libcasm-xtal>=2.0a2
8+
libcasm-xtal>=2.0a5

include/casm/clexulator/ConfigDoFValuesTools.hh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,23 @@ template <typename DoFSetType>
141141
Eigen::MatrixXd local_to_standard_values(
142142
Eigen::MatrixXd const &dof_values, Index N_sublat, Index N_volume,
143143
std::vector<DoFSetType> const &dof_info) {
144+
Index N_sites = N_volume * N_sublat;
144145
Index rows = dof_info.front().basis().rows();
145-
Eigen::MatrixXd standard_values(rows, dof_values.cols());
146+
if (dof_values.rows() != max_dim(dof_info) || dof_values.cols() != N_sites) {
147+
std::stringstream msg;
148+
msg << "Invalid dof values input size in "
149+
"local_to_standard_values: "
150+
<< "Expected rows=" << max_dim(dof_info)
151+
<< ", received rows=" << dof_values.rows()
152+
<< ", expected cols=" << N_sites
153+
<< ", received cols=" << dof_values.cols();
154+
throw std::runtime_error(msg.str());
155+
}
156+
Eigen::MatrixXd standard_values = Eigen::MatrixXd::Zero(rows, N_sites);
146157
for (Index b = 0; b < N_sublat; ++b) {
158+
if (dof_info[b].dim() == 0) {
159+
continue;
160+
}
147161
standard_values.block(0, b * N_volume, rows, N_volume) =
148162
dof_info[b].basis() *
149163
sublattice_block(dof_values, b, N_volume).topRows(dof_info[b].dim());
@@ -161,18 +175,22 @@ Eigen::MatrixXd local_from_standard_values(
161175
standard_values.cols() != N_sites) {
162176
std::stringstream msg;
163177
msg << "Invalid standard values input size in "
164-
"local_dof_values_from_standard_basis: "
178+
"local_from_standard_value: "
165179
<< "Expected rows=" << dof_info.front().basis().rows()
166180
<< ", received rows=" << standard_values.rows()
167181
<< ", expected cols=" << N_sites
168182
<< ", received cols=" << standard_values.cols();
169183
throw std::runtime_error(msg.str());
170184
}
171185
Eigen::MatrixXd result = Eigen::MatrixXd::Zero(max_dim(dof_info), N_sites);
172-
for (Index b = 0; b < N_sublat; ++b)
186+
for (Index b = 0; b < N_sublat; ++b) {
187+
if (dof_info[b].dim() == 0) {
188+
continue;
189+
}
173190
sublattice_block(result, b, N_volume).topRows(dof_info[b].dim()) =
174191
dof_info[b].inv_basis() *
175192
sublattice_block(standard_values, b, N_volume);
193+
}
176194
return result;
177195
}
178196

include/casm/clexulator/DiffClexParamPack.hh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -484,15 +484,6 @@ class DiffClexParamHessKey : public DiffClexParamKey {
484484
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485485
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486486

487-
template <>
488-
struct traits<DiffClexParamPack::EvalMode> {
489-
static const std::string name;
490-
491-
static const std::multimap<DiffClexParamPack::EvalMode,
492-
std::vector<std::string> >
493-
strval;
494-
};
495-
496487
template <>
497488
struct ValAccess<double> {
498489
using size_type = DiffClexParamPack::size_type;
@@ -672,6 +663,15 @@ inline DiffClexParamPack::Key DiffClexParamPack::allocate(
672663

673664
} // namespace clexulator
674665

666+
template <>
667+
struct traits<clexulator::DiffClexParamPack::EvalMode> {
668+
static const std::string name;
669+
670+
static const std::multimap<clexulator::DiffClexParamPack::EvalMode,
671+
std::vector<std::string> >
672+
strval;
673+
};
674+
675675
inline std::ostream &operator<<(
676676
std::ostream &sout, const clexulator::DiffClexParamPack::EvalMode &val) {
677677
sout << to_string<clexulator::DiffClexParamPack::EvalMode>(val);

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ requires = [
77
"ninja",
88
"pybind11>=2.6",
99
"libcasm-global>=2.0.2",
10-
"libcasm-xtal>=2.0a2",
10+
"libcasm-xtal>=2.0a5",
1111
]
1212
build-backend = "setuptools.build_meta"
1313

1414
[project]
1515
name = "libcasm-clexulator"
16-
version = "2.0a2"
16+
version = "2.0a3"
1717
authors = [
1818
{ name="CASM developers", email="[email protected]" },
1919
]
@@ -30,7 +30,7 @@ classifiers = [
3030
]
3131
dependencies = [
3232
"libcasm-global>=2.0.2",
33-
"libcasm-xtal>=2.0a2",
33+
"libcasm-xtal>=2.0a5",
3434
"numpy",
3535
]
3636

python/doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
# The short X.Y version.
9898
version = "2.0"
9999
# The full version, including alpha/beta/rc tags.
100-
release = "2.0a2"
100+
release = "2.0a3"
101101

102102
# The language for content autogenerated by Sphinx. Refer to documentation
103103
# for a list of supported languages.

0 commit comments

Comments
 (0)