Skip to content

Conversation

@garth-wells
Copy link
Member

@garth-wells garth-wells commented Nov 6, 2024

This PR adds a mixed Poisson C++ demo. It is the first mixed method C++ demo added to DOLFINx.

Adding this demo exposed some bugs, incorrect docs and some clumsy code. Fixes include:

  • Removes inconsistency where a FunctionSpace and and FiniteElement both have a value shape, which is usually the same (redundant) and sometimes different (confusing). A FunctionSpace no longer stores a value size.
  • In FiniteElement, it was unclear how 'blocked' elements were handled and the docs were inconsistent. The is now made clear.
  • In numerous places, shared pointers were passed to functions that only required a reference. std::reference_wrapper is now used in containers in interfaces where appropriate in place of a shared pointer.
  • std::optional is now used in FiniteElement for value shape data. This removed confusion around is std::vector<std::size_t>{} unset or is it the value shape for a scalar?

There are no changes to the Python interface.

@garth-wells garth-wells marked this pull request as ready for review November 12, 2024 08:05
@garth-wells garth-wells added this pull request to the merge queue Nov 15, 2024
Merged via the queue into main with commit 594f190 Nov 15, 2024
27 checks passed
@garth-wells garth-wells deleted the garth/cpp-mixed-demo-3 branch November 15, 2024 15:57
jorgensd added a commit to jorgensd/dolfinx_mpc that referenced this pull request Nov 17, 2024
jorgensd added a commit to jorgensd/dolfinx_mpc that referenced this pull request Nov 17, 2024
* Update CI versions and behavior

* Refactor timings, due to:
FEniCS/dolfinx#3487
FEniCS/dolfinx#3488

* API changes from:  FEniCS/dolfinx#3500

* Fix demo

* Install boost

* Set tag

* Only check docker on release branch

* Fixes for refernece value size

* More timing fixes

* Another round of timing changes

* Remove last old timing instance
schnellerhase pushed a commit to schnellerhase/fenics-dolfinx that referenced this pull request Dec 28, 2024
…ent spaces (FEniCS#3500)

* Start on C++ mixed method example

* Tidy up demo

* Undo change

* Lint fix

* Tidy up

* Simplification

* Fix forwarding

* Remove redundant function argument

* Formatting

* Wrapper update

* Consistency fixes

* Fix

* Undo changes

* Consistency fixes

* Undo some changes

* Updates

* Update

* Small fix

* More updates

* Enable demo

* Updates

* Improve readability

* Small updates

* Add CMake file

* Solver fix

* Change solver

* Try mumps

* Verbose test

* Action update

* Print matrix norm

* Test image path update

* Update solve

* Docker update

* CI update

* Demo update

* Split create FunctionSpace function

* Updates

* Update

* Revert

* Revert

* Updates

* Tidy up

* Small fixes

* Small edits

* Simplifications

* Logic fix

* Attempt fix

* Revert

* Change solver

* Updates

* Update

* Simplify

* Simplify

* Update test

* Test update

* Enable demo

* Tidy up

* Simplification

* Simplification

* Demo update

* Doc fix

* Updates

* Wrapper fix

* Test updates

* Quad element update

* Update test

* Test fix

* Updates

* Test update

* Remove value_shape from function space

* Lint

* Constructor fix

* Tidy

* Tidy up

* Tidy

* Work on docs

* Doc updates

* Doc updates

* Simplification

* Revert some lines

* Add comment

* Small fix

* Tidy up

* Simplify

* Work on doc

* Type fix

* Doc updates

* Update docs

* Doc improvements

* Type fix

* Switch solver for PETSc 64-bit int

* Small fix

* Small change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo New demo or demo enhancements/improvements enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants