Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion mfem
Submodule mfem updated 96 files
+1 −1 .github/actions/sanitize/mfem/action.yml
+1 −1 .github/actions/sanitize/restore/action.yml
+42 −0 .github/copilot-instructions.md
+2 −2 .github/workflows/sanitize-tests.yml
+5 −0 .gitlab/jobs/dane.yml
+5 −0 .gitlab/jobs/matrix.yml
+2 −2 .gitlab/scripts/baseline
+6 −8 CHANGELOG
+73 −65 CONTRIBUTING.md
+16 −16 INSTALL
+1 −0 NOTICE
+4 −0 config/cmake/MFEMConfig.cmake.in
+3 −3 config/cmake/modules/FindUMPIRE.cmake
+1 −1 examples/CMakeLists.txt
+1 −1 examples/amgx/makefile
+3 −3 examples/caliper/makefile
+11 −52 examples/ex37.cpp
+183 −23 examples/ex37.hpp
+11 −60 examples/ex37p.cpp
+1 −1 examples/ginkgo/makefile
+5 −2 examples/makefile
+4 −0 fem/CMakeLists.txt
+3 −0 fem/coefficient.hpp
+18 −5 fem/datacollection.cpp
+432 −552 fem/dfem/tuple.hpp
+1 −1 fem/dgmassinv_kernels.hpp
+6 −6 fem/estimators.hpp
+11 −11 fem/gridfunc.cpp
+24 −8 fem/gridfunc.hpp
+2,457 −224 fem/gslib.cpp
+343 −67 fem/gslib.hpp
+15 −13 fem/gslib/findpts_local_2.cpp
+16 −16 fem/gslib/findpts_local_3.cpp
+725 −0 fem/gslib/findptsedge_local_2.cpp
+733 −0 fem/gslib/findptsedge_local_3.cpp
+1,257 −0 fem/gslib/findptssurf_local_3.cpp
+157 −0 fem/gslib/interpolate_local_1.cpp
+19 −19 fem/gslib/interpolate_local_2.cpp
+18 −19 fem/gslib/interpolate_local_3.cpp
+76 −48 fem/integ/bilininteg_mass_kernels.hpp
+33 −37 fem/intrules.hpp
+2 −2 fem/lininteg.hpp
+3 −3 fem/pfespace.cpp
+2 −2 fem/pgridfunc.cpp
+6 −5 fem/pgridfunc.hpp
+66 −10 fem/tmop.cpp
+62 −11 fem/tmop.hpp
+119 −0 fem/tmop/assemble/diag2_limit.cpp
+159 −0 fem/tmop/assemble/diag3_limit.cpp
+197 −0 fem/tmop/assemble/grad2_limit.cpp
+248 −0 fem/tmop/assemble/grad3_limit.cpp
+120 −0 fem/tmop/mult/grad2_limit.cpp
+131 −0 fem/tmop/mult/grad3_limit.cpp
+86 −0 fem/tmop/mult/mult2_limit.cpp
+91 −0 fem/tmop/mult/mult3_limit.cpp
+121 −3 fem/tmop/pa.cpp
+77 −0 fem/tmop/tools/energy2_limit.cpp
+78 −0 fem/tmop/tools/energy3_limit.cpp
+21 −4 general/array.cpp
+39 −0 general/binaryio.hpp
+6 −0 general/forall.hpp
+33 −11 makefile
+2 −1 mesh/CMakeLists.txt
+414 −0 mesh/bb_grid_map.cpp
+199 −0 mesh/bb_grid_map.hpp
+839 −14 mesh/gmsh.cpp
+0 −55 mesh/gmsh.hpp
+9 −2 mesh/mesh.cpp
+4 −1 mesh/mesh.hpp
+1 −0 mesh/mesh_headers.hpp
+0 −3 mesh/mesh_operators.cpp
+0 −1 mesh/mesh_operators.hpp
+0 −1,335 mesh/mesh_readers.cpp
+17 −3 mesh/submesh/psubmesh.hpp
+14 −0 mesh/submesh/submesh.hpp
+54 −5 miniapps/electromagnetics/CMakeLists.txt
+2 −2 miniapps/electromagnetics/makefile
+10 −2 miniapps/gslib/CMakeLists.txt
+130 −66 miniapps/gslib/findpts.cpp
+6 −1 miniapps/gslib/makefile
+77 −53 miniapps/gslib/pfindpts.cpp
+1 −0 miniapps/hooke/hooke.cpp
+1 −0 miniapps/meshing/CMakeLists.txt
+1 −0 miniapps/meshing/fit-node-position.cpp
+1 −1 miniapps/meshing/makefile
+7 −8 miniapps/meshing/mesh-optimizer.cpp
+13 −4 miniapps/meshing/mesh-optimizer.hpp
+8 −9 miniapps/meshing/pmesh-optimizer.cpp
+568 −0 miniapps/meshing/stretched3D.mesh
+21 −24 miniapps/plasma/makefile
+4 −3 miniapps/plasma/pic/makefile
+1 −0 tests/unit/CMakeLists.txt
+1 −1 tests/unit/fem/test_particleset.cpp
+164 −0 tests/unit/mesh/test_bb_grid_map.cpp
+39 −0 tests/unit/mesh/test_mesh.cpp
+100 −18 tests/unit/miniapps/test_tmop_pa.cpp
8 changes: 4 additions & 4 deletions src/smith/numerics/functional/boundary_integral_kernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void evaluation_kernel_impl(trial_element_type trial_elements, test_element, dou

static constexpr int qpts_per_elem = num_quadrature_points(geom, Q);

[[maybe_unused]] tuple u = {
[[maybe_unused]] tuple u{
reinterpret_cast<const typename decltype(type<indices>(trial_elements))::dof_type*>(inputs[indices])...};

// for each element in the domain
Expand All @@ -184,9 +184,9 @@ void evaluation_kernel_impl(trial_element_type trial_elements, test_element, dou
auto x_e = x[e];

// batch-calculate values / derivatives of each trial space, at each quadrature point
[[maybe_unused]] tuple qf_inputs = {promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};
[[maybe_unused]] tuple qf_inputs{promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};

// (batch) evalute the q-function at each quadrature point
auto qf_outputs = batch_apply_qf(qf, t, x_e, J_e, get<indices>(qf_inputs)...);
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/hexahedron_H1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ struct finite_element<mfem::Geometry::CUBE, H1<p, c> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[Q] = std::remove_reference_t<decltype(output[Q])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/hexahedron_Hcurl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ struct finite_element<mfem::Geometry::CUBE, Hcurl<p>> {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {dot(d00, phi_j) + dot(d01, curl_phi_j), dot(d10, phi_j) + dot(d11, curl_phi_j)};
output[Q] = std::remove_reference_t<decltype(output[Q])>{dot(d00, phi_j) + dot(d01, curl_phi_j),
dot(d10, phi_j) + dot(d11, curl_phi_j)};
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/hexahedron_L2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ struct finite_element<mfem::Geometry::CUBE, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[Q] = std::remove_reference_t<decltype(output[Q])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/quadrilateral_H1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ struct finite_element<mfem::Geometry::SQUARE, H1<p, c> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[Q] = std::remove_reference_t<decltype(output[Q])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/quadrilateral_Hcurl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ struct finite_element<mfem::Geometry::SQUARE, Hcurl<p> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {dot(d00, phi_j) + d01 * curl_phi_j, dot(d10, phi_j) + d11 * curl_phi_j};
output[Q] = std::remove_reference_t<decltype(output[Q])>{dot(d00, phi_j) + d01 * curl_phi_j,
dot(d10, phi_j) + d11 * curl_phi_j};
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/smith/numerics/functional/detail/quadrilateral_L2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ struct finite_element<mfem::Geometry::SQUARE, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[Q] = std::remove_reference_t<decltype(output[Q])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}
}

Expand Down Expand Up @@ -213,7 +214,8 @@ struct finite_element<mfem::Geometry::SQUARE, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(Q)));
const auto& d11 = get<1>(get<1>(input(Q)));

output[Q] = {d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
output[Q] =
std::remove_reference_t<decltype(output[Q])>{d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/segment_H1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ struct finite_element<mfem::Geometry::SEGMENT, H1<p, c> > {
const auto& d10 = get<0>(get<1>(input(qx)));
const auto& d11 = get<1>(get<1>(input(qx)));

output[qx] = {d00 * phi_j + d01 * dphi_j_dxi, d10 * phi_j + d11 * dphi_j_dxi};
output[qx] =
std::remove_reference_t<decltype(output[qx])>{d00 * phi_j + d01 * dphi_j_dxi, d10 * phi_j + d11 * dphi_j_dxi};
}

return output;
Expand Down
6 changes: 4 additions & 2 deletions src/smith/numerics/functional/detail/segment_L2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ struct finite_element<mfem::Geometry::SEGMENT, L2<p, c> > {
auto& d10 = get<0>(get<1>(input(qx)));
auto& d11 = get<1>(get<1>(input(qx)));

output[qx] = {d00 * phi_j + d01 * dphi_j_dxi, d10 * phi_j + d11 * dphi_j_dxi};
output[qx] =
std::remove_reference_t<decltype(output[qx])>{d00 * phi_j + d01 * dphi_j_dxi, d10 * phi_j + d11 * dphi_j_dxi};
}

return output;
Expand Down Expand Up @@ -144,7 +145,8 @@ struct finite_element<mfem::Geometry::SEGMENT, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(qx)));
const auto& d11 = get<1>(get<1>(input(qx)));

output[qx] = {d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
output[qx] =
std::remove_reference_t<decltype(output[qx])>{d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
}

return output;
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/tetrahedron_H1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ struct finite_element<mfem::Geometry::TETRAHEDRON, H1<p, c> > {
const auto& d10 = get<0>(get<1>(input(i)));
const auto& d11 = get<1>(get<1>(input(i)));

output[i] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[i] = std::remove_reference_t<decltype(output[i])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}

return output;
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/tetrahedron_L2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ struct finite_element<mfem::Geometry::TETRAHEDRON, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(i)));
const auto& d11 = get<1>(get<1>(input(i)));

output[i] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[i] = std::remove_reference_t<decltype(output[i])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}

return output;
Expand Down
3 changes: 2 additions & 1 deletion src/smith/numerics/functional/detail/triangle_H1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ struct finite_element<mfem::Geometry::TRIANGLE, H1<p, c> > {
const auto& d10 = get<0>(get<1>(input(i)));
const auto& d11 = get<1>(get<1>(input(i)));

output[i] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[i] = std::remove_reference_t<decltype(output[i])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}

return output;
Expand Down
6 changes: 4 additions & 2 deletions src/smith/numerics/functional/detail/triangle_L2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ struct finite_element<mfem::Geometry::TRIANGLE, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(i)));
const auto& d11 = get<1>(get<1>(input(i)));

output[i] = {d00 * phi_j + dot(d01, dphi_j_dxi), d10 * phi_j + dot(d11, dphi_j_dxi)};
output[i] = std::remove_reference_t<decltype(output[i])>{d00 * phi_j + dot(d01, dphi_j_dxi),
d10 * phi_j + dot(d11, dphi_j_dxi)};
}

return output;
Expand Down Expand Up @@ -300,7 +301,8 @@ struct finite_element<mfem::Geometry::TRIANGLE, L2<p, c> > {
const auto& d10 = get<0>(get<1>(input(i)));
const auto& d11 = get<1>(get<1>(input(i)));

output[i] = {d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
output[i] =
std::remove_reference_t<decltype(output[i])>{d00 * phi0_j + d01 * phi1_j, d10 * phi0_j + d11 * phi1_j};
}

return output;
Expand Down
8 changes: 4 additions & 4 deletions src/smith/numerics/functional/domain_integral_kernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void evaluation_kernel_impl(trial_element_tuple trial_elements, test_element, do

[[maybe_unused]] auto qpts_per_elem = num_quadrature_points(geom, Q);

[[maybe_unused]] tuple u = {
[[maybe_unused]] tuple u{
reinterpret_cast<const typename decltype(type<indices>(trial_elements))::dof_type*>(inputs[indices])...};

// for each element in the domain
Expand All @@ -181,9 +181,9 @@ void evaluation_kernel_impl(trial_element_tuple trial_elements, test_element, do

//[[maybe_unused]] static constexpr trial_element_tuple trial_element_tuple{};
// batch-calculate values / derivatives of each trial space, at each quadrature point
[[maybe_unused]] tuple qf_inputs = {promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};
[[maybe_unused]] tuple qf_inputs{promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};

// use J_e to transform values / derivatives on the parent element
// to the to the corresponding values / derivatives on the physical element
Expand Down
2 changes: 1 addition & 1 deletion src/smith/numerics/functional/functional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ class Functional<test(trials...), exec> {
// mfem::Vector arg0 = ...;
// mfem::Vector arg1 = ...;
// e.g. auto [value, gradient_wrt_arg1] = my_functional(arg0, differentiate_wrt(arg1));
return {output_T_, grad_[wrt]};
return smith::tuple<mfem::Vector&, Gradient&>{output_T_, grad_[wrt]};
}

if constexpr (wrt == NO_DIFFERENTIATION) {
Expand Down
2 changes: 1 addition & 1 deletion src/smith/numerics/functional/functional_qoi.inl
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class Functional<double(trials...), exec> {
// mfem::Vector arg0 = ...;
// mfem::Vector arg1 = ...;
// e.g. auto [value, gradient_wrt_arg1] = my_functional(arg0, differentiate_wrt(arg1));
return {output_T_[0], grad_[wrt]};
return smith::tuple<double&, Gradient&>{output_T_[0], grad_[wrt]};
}

if constexpr (wrt == NO_DIFFERENTIATION) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void evaluation_kernel_impl(trial_element_type trial_elements, test_element, dou

static constexpr int qpts_per_elem = num_quadrature_points(geom, Q);

[[maybe_unused]] tuple u = {
[[maybe_unused]] tuple u{
reinterpret_cast<const typename decltype(type<indices>(trial_elements))::dof_type_if*>(inputs[indices])...};

// for each element in the domain
Expand All @@ -172,9 +172,9 @@ void evaluation_kernel_impl(trial_element_type trial_elements, test_element, dou
auto x_e = x[e];

// batch-calculate values / derivatives of each trial space, at each quadrature point
[[maybe_unused]] tuple qf_inputs = {promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};
[[maybe_unused]] tuple qf_inputs{promote_each_to_dual_when < indices ==
differentiation_index >
(get<indices>(trial_elements).interpolate(get<indices>(u)[e], rule))...};

// (batch) evalute the q-function at each quadrature point
auto qf_outputs = batch_apply_qf(qf, t, x_e, J_e, get<indices>(qf_inputs)...);
Expand Down
Loading
Loading