Skip to content

Commit

Permalink
Merge branch 'main' into inclusion_map
Browse files Browse the repository at this point in the history
  • Loading branch information
schnellerhase committed Jan 7, 2025
2 parents 48e8f83 + fb0b994 commit 26be413
Show file tree
Hide file tree
Showing 30 changed files with 89 additions and 90 deletions.
24 changes: 12 additions & 12 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Remove ``Mesh::size``. Use ``Mesh::num_entities`` instead.
- Improved mesh topology computation performance.
- Remove excessive calls to MPI init. It may now be necessary in some
cases to explicitly intialise MPI.
cases to explicitly initialise MPI.
- Improvements to sparsity pattern computation.
- Addition of some interfaces using ``Eigen::Map/ref`` in addition to
``dolfin::Array(View)``. ``dolfin::Array(View)``interfaces will be
Expand Down Expand Up @@ -146,7 +146,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Require polynomial degree or finite element for Expressions in the
Python interface (fixes Issue #355,
https://bitbucket.org/fenics-project/dolfin/issues/355)
- Switch to Google Test framwork for C++ unit tests
- Switch to Google Test framework for C++ unit tests
- Fix bug when reading domain data from mesh file for a ghosted mesh
- Add interface for manipulating mesh geometry using (higher-order) FE
functions: free functions set_coordinates, get_coordinates,
Expand Down Expand Up @@ -223,7 +223,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
#443)
- Add quadrature rules for multimesh/cut-cell integration up to order
6
- Implement MPI reductions and XML ouput of Table class
- Implement MPI reductions and XML output of Table class
- list_timings() is now collective and returns MPI average across
processes
- Add dump_timings_to_xml()
Expand Down Expand Up @@ -324,7 +324,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
module
- Add function Form::set_some_coefficients()
- Remove Boost.MPI dependency
- Change GenericMatrix::compresss to return a new matrix (7be3a29)
- Change GenericMatrix::compress to return a new matrix (7be3a29)
- Add function GenericTensor::empty()
- Deprecate resizing of linear algebra via the GenericFoo interfaces
(fixes #213)
Expand Down Expand Up @@ -387,7 +387,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Fixes bug where child/parent hierarchy in Python were destroyed
- Add utility script dolfin-get-demos
- MeshFunctions in python now support iterable protocol
- Add timed VTK output for Mesh and MeshFunction in addtion to
- Add timed VTK output for Mesh and MeshFunction in addition to
Functions
- Expose ufc::dofmap::tabulate_entity_dofs to GenericDofMap interface
- Expose ufc::dofmap::num_entity_dofs to GenericDofMap interface
Expand Down Expand Up @@ -477,7 +477,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Add sparray method in the Python interface of GenericMatrix,
requires scipy.sparse
- Make methods that return a view of contiguous c-arrays, via a NumPy
array, keep a reference from the object so it wont get out of scope
array, keep a reference from the object so it won't get out of scope
- Add parameter: "use_petsc_signal_handler", which enables/disable
PETSc system signals
- Avoid unnecessary resize of result vector for A*b
Expand Down Expand Up @@ -684,7 +684,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Thread-safe fixed in Function class
- Make GenericFunction::eval thread-safe (Data class removed)
- Optimize and speedup topology computation (mesh.init())
- Add function Mesh::clean() for cleaning out auxilliary topology data
- Add function Mesh::clean() for cleaning out auxiliary topology data
- Improve speed and accuracy of timers
- Fix bug in 3D uniform mesh refinement
- Add built-in meshes UnitTriangle and UnitTetrahedron
Expand Down Expand Up @@ -761,7 +761,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
refinement
- Add functionality for smoothing the boundary of a mesh
- Speedup assembly over exterior facets by not using BoundaryMesh
- Mesh refinement improvements, remove unecessary copying in Python
- Mesh refinement improvements, remove unnecessary copying in Python
interface
- Clean PETSc and Epetra Krylov solvers
- Add separate preconditioner classes for PETSc and Epetra solvers
Expand Down Expand Up @@ -935,7 +935,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
check range
- Add unit tests to the memorycheck
- Add call to clean up libxml2 parser at exit
- Remove unecessary arguments in DofMap member functions
- Remove unnecessary arguments in DofMap member functions
- Remove reference constructors from DofMap, FiniteElement and
FunctionSpace
- Use a shared_ptr to store the mesh in DofMap objects
Expand Down Expand Up @@ -1215,7 +1215,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Disable PETSc by default, use --enable-petsc to enable
- Modify ODE solver interface for u0() and f()
- Add class ConvectionMatrix
- Readd classes LoadVector, MassMatrix, StiffnessMatrix
- Read classes LoadVector, MassMatrix, StiffnessMatrix
- Add matrix factory for simple creation of standard finite element
matrices
- Collect static solvers in LU and GMRES
Expand Down Expand Up @@ -1500,7 +1500,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Update PETSc wrappers NewVector, NewMatrix, and NewGMRES
- Fix initialization of PETSc
- Add mono-adaptive cG(q) and dG(q) solvers (experimental)
- Implementation of new assebly: NewFEM, using output from FFC
- Implementation of new assembly: NewFEM, using output from FFC
- Add access to mesh for nodes, cells, faces and edges
- Add Tecplot I/O interface; contributed by Garth N. Wells

Expand Down Expand Up @@ -1623,7 +1623,7 @@ solver <https://bitbucket.org/fenics-project/dolfin/>`_.
- Optimize Lagrange polynomials
- Optimize sparsity: use stl containers
- Optimize choice of discrete residual for multi-adaptive solver
- Don't save solution in benchmark proble
- Don't save solution in benchmark problem
- Improve computation of divergence factor for underdamped systems
- Don't check residual on first slab for fixed time step
- Decrease largest (default) time step to 0.1
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ if(NOT DOLFINX_UFCX_PYTHON)
# Check in CONFIG mode, i.e. look for installed ufcxConfig.cmake
find_package(ufcx 0.10 REQUIRED CONFIG)
else()
# Check in MODULE mode (using FindUFCX.cmake) using Python intepreter.
# Check in MODULE mode (using FindUFCX.cmake) using Python interpreter.
find_package(
Python3
COMPONENTS Interpreter
Expand Down
4 changes: 2 additions & 2 deletions cpp/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CREATE_SUBDIRS = YES
# level increment doubles the number of directories, resulting in 4096
# directories at level 8 which is the default and also the maximum value. The
# sub-directories are organized in 2 levels, the first level always has a fixed
# numer of 16 directories.
# number of 16 directories.
# Minimum value: 0, maximum value: 8, default value: 8.
# This tag requires that the tag CREATE_SUBDIRS is set to YES.

Expand Down Expand Up @@ -1007,7 +1007,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

# EXCLUDE =
# EXCLUDE =

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
2 changes: 1 addition & 1 deletion cpp/doc/source/jupytext_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def process():
with open(myst_file, "w") as fw:
fw.write(cpp_myst_text)

# There is a posibility to use jupyter-notebooks with C++/C kernels
# There is a possibility to use jupyter-notebooks with C++/C kernels
# ipynb_file = (demo_doc_dir / fname.name).with_suffix(".ipynb")
# jupytext.write(cpp_demo, ipynb_file, fmt="ipynb")

Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/common/IndexMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ compute_submap_indices(const IndexMap& imap,
// If required, preserve the order of the ghost indices
if (order == IndexMapOrder::preserve)
{
// Build (old postion, new position) list for ghosts and sort
// Build (old position, new position) list for ghosts and sort
std::vector<std::pair<std::int32_t, std::int32_t>> pos;
pos.reserve(submap_ghost.size());
for (std::int32_t idx : submap_ghost)
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/common/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct __radix_sort
/// dolfixn::radix_sort(a); // a = {1, 2, 3}
/// @endcode
/// Additionally the projection based approach of the STL library is
/// adpated, which allows for versatile usage, for example the easy
/// adapted, which allows for versatile usage, for example the easy
/// realization of an argsort
/// @code
/// std::array<std::int16_t, 3> a{2, 3, 1};
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/fem/DirichletBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class DirichletBC
if (g->shape.size() != V->element()->value_shape().size())
{
throw std::runtime_error(
"Rank mis-match between Constant and function space in DirichletBC");
"Rank mismatch between Constant and function space in DirichletBC");
}

if (g->value.size() != _function_space->dofmap()->bs())
Expand Down
10 changes: 5 additions & 5 deletions cpp/dolfinx/fem/FiniteElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct BasixElementData
element; ///< Finite element.
std::optional<std::vector<std::size_t>> value_shape
= std::nullopt; ///< Value shape. Can only be set for scalar `element`.
bool symmetry = false; ///< Symmetry. Should ony set set for 2nd-order tensor
bool symmetry = false; ///< Symmetry. Should only set set for 2nd-order tensor
///< blocked elements.
};

Expand All @@ -65,8 +65,8 @@ class FiniteElement
/// for a vector in 3D or `{2, 2}` for a rank-2 tensor in 2D. Can only
/// be set for blocked scalar `element`. For other elements and scalar
/// elements it should be `std::nullopt`.
/// @param[in] symmetric Is the element a symmetric tensor? Should ony
/// set for 2nd-order tensor blocked elements.
/// @param[in] symmetric Is the element a symmetric tensor? Should
/// only set for 2nd-order tensor blocked elements.
FiniteElement(const basix::FiniteElement<geometry_type>& element,
std::optional<std::vector<std::size_t>> value_shape
= std::nullopt,
Expand Down Expand Up @@ -792,7 +792,7 @@ class FiniteElement
/// consistent physical element degree-of-freedom ordering. The
/// permutation is computed in-place.
///
/// @param[in,out] doflist Indicies associated with the
/// @param[in,out] doflist Indices associated with the
/// degrees-of-freedom. Size=`num_dofs`.
/// @param[in] cell_permutation Permutation data for the cell.
void permute(std::span<std::int32_t> doflist,
Expand All @@ -811,7 +811,7 @@ class FiniteElement
/// element degree-of-freedom ordering. The permutation is computed
/// in-place.
///
/// @param[in,out] doflist Indicies associated with the
/// @param[in,out] doflist Indices associated with the
/// degrees-of-freedom. Size=`num_dofs`.
/// @param[in] cell_permutation Permutation data for the cell.
void permute_inv(std::span<std::int32_t> doflist,
Expand Down
10 changes: 5 additions & 5 deletions cpp/dolfinx/fem/Form.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ struct integral_data
/// @param[in] id Domain ID.
/// @param[in] kernel Integration kernel.
/// @param[in] entities Indices of entities to integrate over.
/// @param[in] coeffs Indicies of the coefficients are present
/// (active) in `kernel`.
/// @param[in] coeffs Indices of the coefficients are present (active)
/// in `kernel`.
template <typename K, typename V, typename W>
requires std::is_convertible_v<
std::remove_cvref_t<K>,
Expand All @@ -70,11 +70,11 @@ struct integral_data
/// @param[in] id Domain ID.
/// @param[in] kernel Integration kernel.
/// @param[in] entities Indices of entities to integrate over.
/// @param[in] coeffs Indicies of the coefficients that are active in
/// @param[in] coeffs Indices of the coefficients that are active in
/// the `kernel`.
///
/// @note This version allows `entities` to be passed as a std::span,
/// which is then copied.
/// @note This version allows `entities` to be passed as a
/// `std::span`, which is then copied.
template <typename K, typename W>
requires std::is_convertible_v<
std::remove_cvref_t<K>,
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/fem/interpolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void interpolate(Function<T, U>& u, std::span<const T> f,

namespace impl
{
/// @brief Convenience typdef
/// @brief Convenience typedef
template <typename T, std::size_t D>
using mdspan_t = MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan<
T, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents<std::size_t, D>>;
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/graph/partitioners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ graph::partition_fn graph::kahip::partitioner(int mode, int seed,
// KaHIP internally relies on an unsigned long long int type, which is not
// easily convertible to a general mpi type due to platform specific
// differences. So we can not rely on the general mpi_t<> mapping and do it
// by hand in this sole occurence.
// by hand in this sole occurrence.
MPI_Allgather(&num_local_nodes, 1, MPI_UNSIGNED_LONG_LONG,
node_disp.data() + 1, 1, MPI_UNSIGNED_LONG_LONG, comm);
std::partial_sum(node_disp.begin(), node_disp.end(), node_disp.begin());
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/io/XDMFFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ std::pair<mesh::CellType, int> XDMFFile::read_cell_type(std::string grid_name,
const std::pair<std::string, int> cell_type_str
= xdmf_utils::get_cell_type(topology_node);

// Get toplogical dimensions
// Get topological dimensions
mesh::CellType cell_type = mesh::to_type(cell_type_str.first);

return {cell_type, cell_type_str.second};
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/io/xdmf_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void xdmf_function::add_function(MPI_Comm comm, const fem::Function<T, U>& u,
if (cmap.degree() > 2
and element->basix_element().lagrange_variant() != cmap.variant())
{
throw std::runtime_error("Mis-match in Lagrange family. Maybe the "
throw std::runtime_error("Mismatch in Lagrange family. Maybe the "
"Function needs to be interpolated?");
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/io/xdmf_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ xdmf_mesh::read_topology_data(MPI_Comm comm, hid_t h5_id,
const std::pair<std::string, int> cell_type_str
= xdmf_utils::get_cell_type(topology_node);

// Get toplogical dimensions
// Get topological dimensions
mesh::CellType cell_type = mesh::to_type(cell_type_str.first);

// Get topology dataset node
Expand Down
4 changes: 2 additions & 2 deletions cpp/dolfinx/la/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void orthonormalize(std::vector<std::reference_wrapper<V>> basis)

/// @brief Test if basis is orthonormal.
///
/// Returns true if ||x_i - x_j|| - delta_{ij} < eps fro all i, j, and
/// Returns true if ||x_i - x_j|| - delta_{ij} < eps for all i, j, and
/// otherwise false.
///
/// @param[in] basis Set of vectors to check.
Expand All @@ -361,7 +361,7 @@ bool is_orthonormal(
for (std::size_t i = 0; i < basis.size(); i++)
{
for (std::size_t j = i; j < basis.size(); j++)
{
{
T delta_ij = (i == j) ? T(1) : T(0);
auto dot_ij = inner_product(basis[i].get(), basis[j].get());
if (std::norm(delta_ij - dot_ij) > eps)
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/mesh/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Geometry
{
assert(_x.size() % 3 == 0);
if (_x.size() / 3 != _input_global_indices.size())
throw std::runtime_error("Geometry size mis-match");
throw std::runtime_error("Geometry size mismatch.");

if (_dofmaps.size() != _cmaps.size())
{
Expand Down
6 changes: 3 additions & 3 deletions cpp/dolfinx/mesh/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ Mesh<typename std::remove_reference_t<typename U::value_type>> create_mesh(
auto [unique_end, range_end] = std::ranges::unique(vertices);
vertices.erase(unique_end, range_end);

// Remove -1 if it appears as first entity. This can happend in
// Remove -1 if it appears as first entity. This can happen in
// mixed topology meshes where '-1' is used to pad facet data when
// cells facets have differing numbers of vertices.
if (!vertices.empty() and vertices.front() == -1)
Expand Down Expand Up @@ -1003,7 +1003,7 @@ Mesh<typename std::remove_reference_t<typename U::value_type>> create_mesh(
}
}

// Compute row permutaion
// Compute row permutation
const std::vector<std::int32_t> perm = dolfinx::sort_by_perm(
std::span<const std::int64_t>(facets0), max_v);

Expand Down Expand Up @@ -1132,7 +1132,7 @@ Mesh<typename std::remove_reference_t<typename U::value_type>> create_mesh(
/// rank for each cell. If not callable, cells are not redistributed.
/// @return A mesh distributed on the communicator `comm`.
///
/// This constructor provdes a simplified interface to the more general
/// This constructor provides a simplified interface to the more general
/// ::create_mesh constructor, which supports meshes with more than one
/// cell type.
template <typename U>
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/refinement/interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ compute_refinement_data(const mesh::Mesh<T>& mesh,
}

assert(cell_topology.size() == 2 * refined_cell_count);
assert((!compute_parent_cell) || (parent_cell->size() == refined_cell_count));
assert(!compute_parent_cell or parent_cell->size() == refined_cell_count);

std::vector<std::int32_t> offsets(refined_cell_count + 1);
std::ranges::generate(offsets, [i = 0]() mutable { return 2 * i++; });
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/mesh/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ TEMPLATE_TEST_CASE("Interval mesh (parallel)", "[mesh][interval]", float,
{2}, {2}, {2, 0}, {0, 2}, {0}, {0}, {0}};
}
else
FAIL("Test only supports <= 3 processes");
SKIP("Test only supports <= 3 processes");

return graph::AdjacencyList<std::int32_t>(std::move(data));
};
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/mesh/refinement/interval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ TEMPLATE_TEST_CASE("Interval Refinement (parallel)",
TEMPLATE_TEST_CASE("Interval uniform refinement", "[refinement][interva]",
double, float)
{
auto interval
= dolfinx::mesh::create_interval<TestType>(MPI_COMM_WORLD, 2, {0.0, 1.0});
auto interval = dolfinx::mesh::create_interval<TestType>(MPI_COMM_WORLD, 20,
{0.0, 1.0});
auto [refined, parent_edge, parent_facet]
= dolfinx::refinement::refine(interval, std::nullopt);
CHECK(refined.topology()->index_map(0)->size_global() == 5);
CHECK(refined.topology()->index_map(0)->size_global() == 41);
}
3 changes: 1 addition & 2 deletions python/demo/demo_half_loaded_waveguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
# $\mathrm{TM}_x$ modes, and the possible $k_z$ can be found by solving
# a set of transcendental equations, which is shown here below:
#
#
# $$
# \textrm{For TE}_x \textrm{ modes}:
# \begin{cases}
Expand Down Expand Up @@ -234,7 +233,7 @@ def Omega_v(x):
# wavelength, which we consider fixed at $\lambda = h/0.2$. If we focus
# on non-magnetic material only, we can also use $\mu_r=1$.
#
# Now we can assume a known dependance on $z$:
# Now we can assume a known dependence on $z$:
#
# $$
# \mathbf{E}(x, y, z)=\left[\mathbf{E}_{t}(x, y)+\hat{z} E_{z}(x, y)\right]
Expand Down
4 changes: 3 additions & 1 deletion python/demo/demo_hdg.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ def u_e(x):
# Apply Dirichlet boundary conditions
# We begin by locating the boundary facets of msh
msh_boundary_facets = mesh.exterior_facet_indices(msh.topology)

# Since the boundary condition is enforced in the facet space, we must
# use the mesh_to_facet_mesh map to get the corresponding facets in
# facet_mesh
facet_mesh_boundary_facets = mesh_to_facet_mesh[msh_boundary_facets]
# Get the dofs and apply the bondary condition

# Get the dofs and apply the boundary condition
facet_mesh.topology.create_connectivity(fdim, fdim)
dofs = fem.locate_dofs_topological(Vbar, fdim, facet_mesh_boundary_facets)
bc = fem.dirichletbc(dtype(0.0), dofs, Vbar)
Expand Down
Loading

0 comments on commit 26be413

Please sign in to comment.