Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse Basix element instead of recreating from generated code #3136

Merged
merged 103 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
540d996
remove create_functionspace from UFCx functionspace
mscroggs Mar 21, 2024
2255926
Create basix elements in demos instead of using generated code
mscroggs Mar 21, 2024
400c491
update matrix test
mscroggs Mar 21, 2024
ed65653
<double>
mscroggs Mar 21, 2024
7f4bad0
update test
mscroggs Mar 21, 2024
58b0a02
wrap FiniteElement(basix_element, block_size) initialiser
mscroggs Mar 21, 2024
fb863a1
create function space from element where possible
mscroggs Mar 21, 2024
d51013d
remove failicg check of signatures
mscroggs Mar 21, 2024
1f7e644
dtype
mscroggs Mar 21, 2024
d696628
remove duplicate dtype
mscroggs Mar 21, 2024
5de1936
Basix branch
mscroggs Mar 21, 2024
1030c28
update tests
mscroggs Apr 16, 2024
ce84262
ruff
mscroggs Apr 16, 2024
d7776ed
ruff format with updated ruff
mscroggs Apr 16, 2024
c2f4030
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 16, 2024
c7609db
update test
mscroggs Apr 16, 2024
c175dd4
Make mixed elements work without FFCx
mscroggs Apr 16, 2024
aed1cfb
Merge branch 'mscroggs/element-from-basix' of github.com:FEniCS/dolfi…
mscroggs Apr 16, 2024
b9f2429
ruff
mscroggs Apr 16, 2024
9447b4a
typing
mscroggs Apr 16, 2024
e57084e
isort
mscroggs Apr 16, 2024
468bbb4
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 16, 2024
7c6c292
brnach
mscroggs Apr 16, 2024
d5fbb4a
petsc realtype?
mscroggs Apr 16, 2024
847d8d0
ruff
mscroggs Apr 16, 2024
ef9dc41
ScalarType not RealType
mscroggs Apr 16, 2024
3cfafe9
real?
mscroggs Apr 16, 2024
6af9252
simplify?
mscroggs Apr 16, 2024
9a1482f
dtypes
mscroggs Apr 16, 2024
26668b4
dtype eps
mscroggs Apr 16, 2024
e151693
quadrature element without ufcx
mscroggs Apr 17, 2024
21fe9cc
working on removing ufcx_dofmap
mscroggs Apr 17, 2024
ad2e46a
fix tests
mscroggs Apr 17, 2024
6680e81
simplifying
mscroggs Apr 17, 2024
bc7ff36
use sub_e not ufcx_dofmap
mscroggs Apr 17, 2024
4787cf8
goodbye ufcx_dofmap
mscroggs Apr 17, 2024
78d778d
simplify
mscroggs Apr 17, 2024
2cb985a
goodbye ufcx_dofmap
mscroggs Apr 17, 2024
51402e5
remove old functions that use ufcx_dofmap
mscroggs Apr 17, 2024
fab7ca2
remove ufcx_dofmap from docs, ruff
mscroggs Apr 17, 2024
623c63f
comment out last ufcx_element
mscroggs Apr 17, 2024
2669967
doc
mscroggs Apr 17, 2024
cc7d531
remove jitting of elements
mscroggs Apr 17, 2024
5332dc9
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 17, 2024
c1f5393
Update cpp/dolfinx/fem/FiniteElement.cpp
mscroggs Apr 18, 2024
94dcd92
Update cpp/dolfinx/fem/FiniteElement.h
mscroggs Apr 18, 2024
cc5c16e
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 18, 2024
f0e2e34
Merge remote-tracking branch 'origin/main' into mscroggs/element-from…
garth-wells Apr 21, 2024
813fe02
Use constructor initialisers
garth-wells Apr 21, 2024
83da137
Merge branch 'main' into mscroggs/element-from-basix
garth-wells Apr 22, 2024
0865166
Interpolation for symmetric tensor
mscroggs Apr 23, 2024
b009cab
add test
mscroggs Apr 23, 2024
a23b12a
correct test
mscroggs Apr 23, 2024
50dbe55
ffc branch
mscroggs Apr 23, 2024
09a1f85
main ffcx
mscroggs Apr 23, 2024
3f1b30a
tidy test
mscroggs Apr 23, 2024
8741fe9
doc
mscroggs Apr 23, 2024
fd590e8
dtype
mscroggs Apr 23, 2024
06f9e67
Merge branch 'main' into mscroggs/symmetric
mscroggs Apr 23, 2024
e83ebd3
Merge branch 'mscroggs/symmetric' into mscroggs/element-from-basix
mscroggs Apr 23, 2024
a09d205
remove dtype
mscroggs Apr 23, 2024
d1880a4
remove dtype from test
mscroggs Apr 23, 2024
37bc3a6
Merge branch 'mscroggs/symmetric' into mscroggs/element-from-basix
mscroggs Apr 23, 2024
e835d9a
symmetric
mscroggs Apr 23, 2024
ebfa2e3
ruff
mscroggs Apr 23, 2024
45c34a4
Merge branch 'main' into mscroggs/symmetric
mscroggs Apr 23, 2024
0b03f8f
Make interpolation work on more than one cell
mscroggs Apr 23, 2024
99d744e
use ordering of lower part not upper part
mscroggs Apr 23, 2024
ed3a1b7
make test ues 3 by 3 not 6 by 6
mscroggs Apr 23, 2024
7556330
Merge branch 'main' into mscroggs/symmetric
mscroggs Apr 23, 2024
fa14793
move interpolation test
mscroggs Apr 23, 2024
d07f54a
Fix #3164
mscroggs Apr 23, 2024
d048bec
Merge branch 'mscroggs/symmetric' of github.com:FEniCS/dolfinx into m…
mscroggs Apr 23, 2024
3e0bf42
Merge branch 'mscroggs/symmetric' into mscroggs/element-from-basix
mscroggs Apr 23, 2024
48c923b
is_symmetric
mscroggs Apr 23, 2024
e4852d0
, False
mscroggs Apr 24, 2024
9a80ac3
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 24, 2024
ba4612d
Merge branch 'main' into mscroggs/element-from-basix
garth-wells Apr 24, 2024
96b750b
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 25, 2024
9ccbd62
use Basix main
mscroggs Apr 25, 2024
8b18042
remove basix.default_scalar_type
mscroggs Apr 25, 2024
8b61227
dtype=default_real_type
mscroggs Apr 25, 2024
b5d8d91
ruff
mscroggs Apr 25, 2024
e343a76
fix TODOs
mscroggs Apr 25, 2024
6ec34e6
demo_lagrange_variants
mscroggs Apr 25, 2024
2e6e5a7
default_real_type
mscroggs Apr 25, 2024
d74d9bf
fix
mscroggs Apr 25, 2024
c8bc43c
default_real_type in more demos
mscroggs Apr 25, 2024
22d5093
dtype=default_real_type in tests
mscroggs Apr 25, 2024
c63888a
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 26, 2024
affecd2
Simplify constructors
garth-wells Apr 26, 2024
0af2ba3
Simplify
garth-wells Apr 26, 2024
afa6213
Merge branch 'main' into mscroggs/element-from-basix
garth-wells Apr 26, 2024
8f3ad8e
add comments
mscroggs Apr 26, 2024
98e3777
Revert "Simplify constructors" - experiment to see if this caused fai…
mscroggs Apr 26, 2024
d697a21
consts
mscroggs Apr 26, 2024
d005311
Revert "consts"
mscroggs Apr 26, 2024
b86dad0
Revert "Revert "Simplify constructors" - experiment to see if this ca…
mscroggs Apr 26, 2024
e7cef72
Small fix
garth-wells Apr 26, 2024
110189a
move implementation to cpp file
mscroggs Apr 26, 2024
98ccada
Merge branch 'main' into mscroggs/element-from-basix
mscroggs Apr 26, 2024
77123b0
Reordering and linting
garth-wells Apr 26, 2024
1fe248d
Simplifications
garth-wells Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cpp/demo/biharmonic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
// convenience we also include the DOLFINx namespace.

#include "biharmonic.h"
#include <basix/finite-element.h>
#include <cmath>
#include <dolfinx.h>
#include <dolfinx/common/types.h>
Expand Down Expand Up @@ -162,9 +163,14 @@ int main(int argc, char* argv[])
// A function space object, which is defined in the generated code,
// is created:

auto element = basix::create_element<U>(
basix::element::family::P, basix::cell::type::triangle, 2,
basix::element::lagrange_variant::unset,
basix::element::dpc_variant::unset, false);

// Create function space
auto V = std::make_shared<fem::FunctionSpace<U>>(
fem::create_functionspace(functionspace_form_biharmonic_a, "u", mesh));
fem::create_functionspace(mesh, element));

// The source function $f$ and the penalty term $\alpha$ are
// declared:
Expand Down
9 changes: 7 additions & 2 deletions cpp/demo/hyperelasticity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ int main(int argc, char* argv[])
mesh::CellType::tetrahedron,
mesh::create_cell_partitioner(mesh::GhostMode::none)));

auto V = std::make_shared<fem::FunctionSpace<U>>(fem::create_functionspace(
functionspace_form_hyperelasticity_F_form, "u", mesh));
auto element = basix::create_element<U>(
basix::element::family::P, basix::cell::type::tetrahedron, 1,
basix::element::lagrange_variant::unset,
basix::element::dpc_variant::unset, false);

auto V = std::make_shared<fem::FunctionSpace<U>>(
fem::create_functionspace(mesh, element, {3}));

auto B = std::make_shared<fem::Constant<T>>(std::vector<T>{0, 0, 0});
auto traction = std::make_shared<fem::Constant<T>>(std::vector<T>{0, 0, 0});
Expand Down
8 changes: 7 additions & 1 deletion cpp/demo/poisson/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
// namespace.

#include "poisson.h"
#include <basix/finite-element.h>
#include <cmath>
#include <dolfinx.h>
#include <dolfinx/fem/Constant.h>
Expand Down Expand Up @@ -114,8 +115,13 @@ int main(int argc, char* argv[])
mesh::create_rectangle<U>(MPI_COMM_WORLD, {{{0.0, 0.0}, {2.0, 1.0}}},
{32, 16}, mesh::CellType::triangle, part));

auto element = basix::create_element<U>(
basix::element::family::P, basix::cell::type::triangle, 1,
basix::element::lagrange_variant::unset,
basix::element::dpc_variant::unset, false);

auto V = std::make_shared<fem::FunctionSpace<U>>(
fem::create_functionspace(functionspace_form_poisson_a, "u", mesh));
fem::create_functionspace(mesh, element, {}));

// Next, we define the variational formulation by initializing the
// bilinear and linear forms ($a$, $L$) using the previously
Expand Down
7 changes: 6 additions & 1 deletion cpp/demo/poisson_matrix_free/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// ## C++ program

#include "poisson.h"
#include <basix/finite-element.h>
#include <cmath>
#include <complex>
#include <concepts>
Expand Down Expand Up @@ -137,8 +138,12 @@ void solver(MPI_Comm comm)
auto mesh = std::make_shared<mesh::Mesh<U>>(mesh::create_rectangle<U>(
comm, {{{0.0, 0.0}, {1.0, 1.0}}}, {10, 10}, mesh::CellType::triangle,
mesh::create_cell_partitioner(mesh::GhostMode::none)));
auto element = basix::create_element<U>(
basix::element::family::P, basix::cell::type::triangle, 2,
basix::element::lagrange_variant::unset,
basix::element::dpc_variant::unset, false);
auto V = std::make_shared<fem::FunctionSpace<U>>(
fem::create_functionspace(functionspace_form_poisson_M, "ui", mesh));
fem::create_functionspace(mesh, element, {}));

// Prepare and set Constants for the bilinear form
auto f = std::make_shared<fem::Constant<T>>(-6.0);
Expand Down
Loading
Loading