Releases: Technologicat/extrafeathers
Releases · Technologicat/extrafeathers
Version 0.4.0
Added:
- Quadrilateral elements are now supported.
- The support for quad elements in the legacy FEniCS itself is incomplete and buggy. It has been fixed in DOLFINx, but we do not support the next-gen FEniCS yet. So although
extrafeathersalready supports arbitrary quad meshes, this functionality is currently practically useful mostly for quad meshes on the unit square. - Like in FEniCS itself, mixed meshes (having both quads and triangles) are not supported.
- The support for quad elements in the legacy FEniCS itself is incomplete and buggy. It has been fixed in DOLFINx, but we do not support the next-gen FEniCS yet. So although
- Add
prepare_linear_export. Seedemo.coupled.main01_flowanddemo.boussinesq.main01_solvefor usage examples. - Add
quad_to_trito convert a quad mesh to a triangle mesh in a crossed-diagonal format, by adding a node at each cell center and then replacing each quad by four triangles.- Note that emulating quad interpolation this way does not actually interpolate bilinearly; the interpolation remains linear on triangles. This produces minor visual artifacts when compared to actual bilinear interpolation. Still, the result looks ok-ish, and lets
mpiplot(ab)use Matplotlib to plot FEM functions on quadrilaterals.
- Note that emulating quad interpolation this way does not actually interpolate bilinearly; the interpolation remains linear on triangles. This produces minor visual artifacts when compared to actual bilinear interpolation. Still, the result looks ok-ish, and lets
- Add
trimeshto triangulate the unit square using equilateral triangles (halves of them at two opposite edges). - Add
minmaxto extract theminandmaxof a FEM field on nodal elements. Modes available for raw, abs, l2 (euclidean length). When running in MPI mode, automatically gathers data from all processes. The data may live on an arbitrary subspace (e.g. a component of a vector field that itself lives on aMixedElement). - Add
renumber_nodes_by_distance. Can set the origin point. - Add
collapse_node_numbering. Likedolfin.FunctionSpace.collapse, but for theextrafeathersinternal format (cellslist andnodesdict, as produced byall_cells). This is sometimes needed; if curious, see the source code of themeshmagicandplotmagicmodules for use cases. - Add interptest demo, to show interpolation of a bilinear function on the unit square on different element types.
- Add smoothing demo, to show the effects of P1->DP0->P1 (and Q1->DQ0->Q1) projection smoothing. This is a technique to eliminate a symmetric numerical checkerboard oscillation with only minor damage to the actual signal.
- Add Eulerian solid mechanics demo: axially moving Kelvin-Voigt sheet using an Eulerian description, with both dynamic and steady-state solvers.
- This is actually a small open-source research code into the mechanics of axially moving materials, with applications in the analysis of industrial processes. Placing the code here facilitates co-evolving
extrafeatherswith features our research team currently actually needs. - Quadrilateral elements look nice for this.
- This is actually a small open-source research code into the mechanics of axially moving materials, with applications in the analysis of industrial processes. Placing the code here facilitates co-evolving
Changed:
- Improved support for discontinuous spaces (DP1, DP2, DP3, DQ1, DQ2, and DQ3) in various library functions.
mpiplotandmpiplot_meshnow support also piecewise constant spaces (DP0andDQ0).mpiplotnow rejects input if the function space is not supported, instead of trying to project.- This is to ensure a faithful representation.
- Plotting preparation changed; now both
mpiplotandmpiplot_meshcan take theprepargument.- Both
mpiplot_prepareandas_mpl_triangulationgenerate aprep. These have slightly different options and different use cases. mpiplottakes the output ofmpiplot_prepare, andmpiplot_meshthat ofas_mpl_triangulation.
- Both
- Rename
midpoint_refinetorefine_for_export, since that's the use, and it handles both degree-2 and degree-3 spaces. - Rename
map_refined_P1tomap_coincident, and generalize it.- Now works at least with P1, P2, P3, Q1, Q2, Q3, DP0, DP1, DP2, DP3, DQ0, DQ1, DQ2, and DQ3 spaces.
- Also, add a squared-distance tolerance option for detecting coincident nodes.
Version 0.3.0
0.3.0 (15 March 2022):
Fixed:
mpiplotnow works correctly for tensor/vector component functions (mpiplot(u.sub(k)))- The global DOF numbers are now correctly mapped to vertices of the Matplotlib triangulation.
mpiplotnow L2-projects (instead of interpolating) if the input is not P1, P2 or P3.all_cellsno longer crashes if some MPI process has no cells.as_mpl_triangulation,mpiplot_meshno longer crash if some MPI process has no triangles.- Fixes to solvers:
pdes.navier_stokes:- Zero out mean pressure only if no Dirichlet BCs on pressure (e.g. cavity flow test cases are like this).
- Thus, now the pressure solution actually satisfies the Dirichlet BCs if any were given.
- Fix crash during form compilation if the pressure space is dG0. Using that space doesn't work, because we need to take the gradient in the corrector steps of IPCS, but it shouldn't crash compilation.
- Zero out mean pressure only if no Dirichlet BCs on pressure (e.g. cavity flow test cases are like this).
solver.step()now returns the number of Krylov iterations taken. Seepdes.navier_stokesandpdes.advection_diffusionfor details.
- Fixes to demos:
- Fix Courant number computation.
- Fix ETA computation: take maximum estimate across MPI processes.
- Improve stabilizer status indicators.
- Update statistics only at visualization steps, to run (up to 15%) faster.
Changed:
mpiplotnow hasshow_meshandshow_partitioningflags.- The mesh is drawn translucently on top of the function data, allowing to see at a glance whether the discretization looks fine or if more resolution is needed at some parts of the domain.
- When not displaying the MPI partitioning,
mpiplot(u, show_mesh=True)is more efficient thanmpiplot(u)followed separately bympiplot_mesh(u.function_space().mesh()), because it constructs the full nodal resolution Matplotlib triangulation just once.
all_cells/my_cellsnow refines P3 meshes, too. Used bympiplotandmidpoint_refine, so these can now refine P3 data into full-nodal-resolution P1 for visualization and export. Each P3 triangle is split into nine P1 triangles, with an aesthetically pleasing fill.- Demos involving incompressible flow now run also when using a P1P1 discretization, which is LBB-incompatible.
- Based on a least-squares pressure smoothing technique to eliminate high spatial frequency numerical oscillations in the pressure field. Details in the docstring of
pdes.navier_stokes.NavierStokes, and in the demosdemo.coupled.main01_flowanddemo.boussinesq.main01_solve. - P1P1 is not as accurate as P2P1 on the same mesh, but is much faster; may be useful for an initial investigation when there is a need to complete many ballpark simulations quickly.
- The main point, however, is that now it is possible to choose a P1 space for the velocity field, should one desire to do so.
- Based on a least-squares pressure smoothing technique to eliminate high spatial frequency numerical oscillations in the pressure field. Details in the docstring of
- Refactor
pdes.advection_diffusioninto a generic constant-coefficientAdvectionDiffusion, and a separate, specificHeatEquation. - Add a logo for the project.
- Tweak parameters of Boussinesq example.
Added:
- New functions:
mpiplot_meshto plot the whole mesh in the root process.- The mesh is optionally color-coded by MPI partitioning.
- The added subdivisions for P1 visualization of P2 and P3 fields can be optionally shown; by default, these are drawn in a more translucent color to distinguish them from element edges.
patch_averageto compute the patch average of a P1/P2/P3 function. Works on scalars/vectors/tensors.
- New demos:
demo.dofnumbering: visualize how FEniCS allocates its global DOFs (in 2D), both in serial and in parallel. Display also the MPI partitioning of the mesh.demo.refelement: visualize the DOF numbering on a P2 or P3 element (in 2D), both locally (reference element) and globally (on a very small triangle mesh on the unit square).- MPI mode draws these diagrams individually for each process.
demo.patch_average: demo of the newpatch_averagefunction.demo.poisson_dg: Poisson equation using symmetric interior penalty discontinuous Galerkin (SIPG) method.- Based on existing FEniCS demos and various internet sources. The main motivation of having this here is to collect the relevant information and links into one place. Each term of the variational problem is commented in detail, conceptually different but similar-looking terms are kept separate (e.g. Nitsche vs. dG stabilization), and the formulation accounts for a general Dirichlet BC. Comments also explain how to add Neumann and Robin BCs.
- New other:
countlines.pyfor project SLOC estimation. This is the same script as inmcpyrateandunpythonic.
Version 0.2.0
0.2.0 (25 February 2022):
- Public API reorganized.
- Solvers now included as subpackage
extrafeathers.pdes.- Not loaded automatically; if you need it, import explicitly.
- Stabilize Navier-Stokes and advection-diffusion solvers.
- Skew-symmetric advection term for divergence-free velocity field for both.
- SUPG (Streamline Upwinding Petrov-Galerkin) for both.
- LSIC (Least squares incompressibility) for Navier-Stokes.
- PSPG (Pressure stabilizing Petrov-Galerkin) for Navier-Stokes.
- Add Boussinesq flow (natural convection) demo, demonstrating a two-way coupled problem.
- License is now 2-clause BSD.