-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in
create_functionspace
(#3355)
* Fix issue 3345 * Remove {} * Update cpp/test/fem/functionspace.cpp Co-authored-by: Jørgen Schartum Dokken <[email protected]> * {} style --------- Co-authored-by: Jørgen Schartum Dokken <[email protected]>
- Loading branch information
1 parent
4d4a864
commit e93606b
Showing
3 changed files
with
35 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2024 Paul Kühner | ||
// | ||
// This file is part of DOLFINX (https://www.fenicsproject.org) | ||
// | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include <basix/finite-element.h> | ||
|
||
#include <dolfinx/fem/FunctionSpace.h> | ||
#include <dolfinx/fem/utils.h> | ||
#include <dolfinx/mesh/Mesh.h> | ||
#include <dolfinx/mesh/generation.h> | ||
|
||
using namespace dolfinx; | ||
|
||
TEST_CASE("Create Function Space (mismatch of elements)", "[functionspace]") | ||
{ | ||
auto mesh = std::make_shared<mesh::Mesh<double>>( | ||
dolfinx::mesh::create_rectangle<double>( | ||
MPI_COMM_SELF, {{{0, 0}, {1, 1}}}, {1, 1}, mesh::CellType::triangle)); | ||
|
||
auto element = basix::create_element<double>( | ||
basix::element::family::P, basix::cell::type::interval, 1, | ||
basix::element::lagrange_variant::unset, | ||
basix::element::dpc_variant::unset, false); | ||
|
||
CHECK_THROWS(fem::create_functionspace<double>(mesh, element, {})); | ||
} |