Skip to content
Snippets Groups Projects
Commit a9d711ce authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add tests for IntegrateOnCells

parent d1514df1
No related branches found
No related tags found
1 merge request!128Feature/unit tests
......@@ -150,10 +150,12 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
} else if constexpr (Dimension == 2) {
switch (cell_type[cell_id]) {
......@@ -181,10 +183,12 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
} else {
static_assert(Dimension == 3);
......@@ -218,8 +222,10 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
value[index] += qf.weight(i_point) * T.jacobianDeterminant(xi) * convert_result(std::move(result));
}
} else {
// LCOV_EXCL_START
throw NotImplementedError("integration on pyramid with non-quadrangular base (number of nodes " +
std::to_string(cell_to_node.size()) + ")");
// LCOV_EXCL_STOP
}
break;
}
......@@ -279,8 +285,10 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
}
} else {
// LCOV_EXCL_START
throw NotImplementedError("integration on diamond with non-quadrangular base (" +
std::to_string(cell_to_node.size()) + ")");
// LCOV_EXCL_STOP
}
break;
}
......@@ -311,21 +319,25 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
}
tokens.release(t);
});
// LCOV_EXCL_START
if (invalid_cell.first) {
std::ostringstream os;
os << "invalid cell type for integration: " << name(cell_type[invalid_cell.second]);
throw UnexpectedError(os.str());
}
// LCOV_EXCL_STOP
}
template <typename MeshType, typename OutputArrayT, typename ListTypeT>
......@@ -391,10 +403,12 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
} else if constexpr (Dimension == 2) {
switch (cell_type[cell_id]) {
......@@ -423,10 +437,12 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
} else {
static_assert(Dimension == 3);
......@@ -458,7 +474,9 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
value[index] += qf.weight(i_point) * T.jacobianDeterminant(xi) * convert_result(std::move(result));
}
} else {
// LCOV_EXCL_START
throw NotImplementedError("integration on pyramid with non-quadrangular base");
// LCOV_EXCL_STOP
}
break;
}
......@@ -512,8 +530,10 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
}
} else {
// LCOV_EXCL_START
throw NotImplementedError("integration on diamond with non-quadrangular base (" +
std::to_string(cell_to_node.size()) + ")");
// LCOV_EXCL_STOP
}
break;
}
......@@ -544,21 +564,25 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu
}
break;
}
// LCOV_EXCL_START
default: {
invalid_cell = std::make_pair(true, cell_id);
break;
}
// LCOV_EXCL_STOP
}
}
tokens.release(t);
});
// LCOV_EXCL_START
if (invalid_cell.first) {
std::ostringstream os;
os << "invalid cell type for integration: " << name(cell_type[invalid_cell.second]);
throw UnexpectedError(os.str());
}
// LCOV_EXCL_STOP
}
public:
......
......@@ -98,6 +98,7 @@ add_executable (unit_tests
test_GaussQuadratureDescriptor.cpp
test_IfProcessor.cpp
test_IncDecExpressionProcessor.cpp
test_IntegrateOnCells.cpp
test_INodeProcessor.cpp
test_ItemId.cpp
test_ItemType.cpp
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment