Commit 9ed07a41 authored by Kendrick, Coleman's avatar Kendrick, Coleman
Browse files

Removed some number density checks no longer needed

Since the effective number density and packing fraction has
been added to MaterialBuilder, the tests where mass density
and ZParam cannot be set with number density have been removed
because setting both is possible now.
parent d9f75ef3
......@@ -111,21 +111,6 @@ ReadMaterial::validateInputs(const MaterialParameters &params) {
result["UnitCellVolume"] =
"UnitCellVolume must be provided with ZParameter";
}
if (!isEmpty(params.numberDensity)) {
result["ZParameter"] = "Cannot give ZParameter with NumberDensity set";
}
if (!isEmpty(params.massDensity)) {
result["MassDensity"] = "Cannot give MassDensity with ZParameter set";
}
} else if (!isEmpty(params.numberDensity)) {
if (!isEmpty(params.massDensity)) {
result["MassDensity"] = "Cannot give MassDensity with NumberDensity set";
}
bool canCalculateMassDensity =
((!isEmpty(params.mass)) && (!isEmpty(params.volume)));
if (canCalculateMassDensity) {
result["MassDensity"] = "Cannot give MassDensity with NumberDensity set";
}
}
return result;
}
......
......@@ -211,7 +211,7 @@ public:
TS_ASSERT(result.empty());
}
void testFailureValidateInputsNumberAndZParam() {
void testSuccessfulValidateInputsNumberAndZParam() {
const ReadMaterial::MaterialParameters params = []() -> auto {
ReadMaterial::MaterialParameters setMaterial;
setMaterial.atomicNumber = 1;
......@@ -225,8 +225,7 @@ public:
auto result = ReadMaterial::validateInputs(params);
TS_ASSERT_EQUALS(result["ZParameter"],
"Cannot give ZParameter with NumberDensity set")
TS_ASSERT(result.empty());
}
void testFailureValidateInputsNumbersAndPacking() {
......@@ -340,7 +339,7 @@ public:
TS_ASSERT(result.empty());
}
void testFailureValidateInputsZParamWithMass() {
void testSuccessfulValidateInputsZParamWithMass() {
const ReadMaterial::MaterialParameters params = []() -> auto {
ReadMaterial::MaterialParameters setMaterial;
setMaterial.atomicNumber = 1;
......@@ -354,8 +353,7 @@ public:
auto result = ReadMaterial::validateInputs(params);
TS_ASSERT_EQUALS(result["MassDensity"],
"Cannot give MassDensity with ZParameter set")
TS_ASSERT(result.empty());
}
void testFailureValidateInputsZParamWithoutUnitCell() {
......@@ -374,7 +372,7 @@ public:
"UnitCellVolume must be provided with ZParameter")
}
void testFailureValidateInputsNumWithMass() {
void testSuccessfulValidateInputsNumWithMass() {
const ReadMaterial::MaterialParameters params = []() -> auto {
ReadMaterial::MaterialParameters setMaterial;
setMaterial.atomicNumber = 1;
......@@ -387,8 +385,7 @@ public:
auto result = ReadMaterial::validateInputs(params);
TS_ASSERT_EQUALS(result["MassDensity"],
"Cannot give MassDensity with NumberDensity set")
TS_ASSERT(result.empty());
}
void testMaterialIsCorrect() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment