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

Flatten integral domains in C++ #2225

Merged
merged 12 commits into from
Jun 11, 2022
Merged

Conversation

jorgensd
Copy link
Sponsor Member

@jorgensd jorgensd commented Jun 1, 2022

The current usage of std::vector<std::int32_t>, std::vector<std::pair<std::int32_t, int>>, std::vector<std::tuple<std::int32_t, int,std::int32_t, int> is overly complicated, when we always know the second dimension of the array when accessed.

Additionally, the second int (referring to the local entity index for a facet) can be an std::int32_t without adding any new assumptions to the code.

This pull request flattens the C++ layout of all these entities to std::vector<std::int32_t>.
The Python interface still reshapes the data to be 1,2 or 3 dimensional.

This change also makes it easier to pass integral entities down to C++ for exterior libraries, as all the entities in DOLFINx has the same type.

cpp/dolfinx/fem/Form.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Form.h Show resolved Hide resolved
cpp/dolfinx/fem/Form.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_matrix_impl.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_matrix_impl.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/utils.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/utils.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/utils.h Show resolved Hide resolved
python/dolfinx/wrappers/fem.cpp Outdated Show resolved Hide resolved
python/dolfinx/wrappers/fem.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_matrix_impl.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_scalar_impl.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_vector_impl.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/assemble_vector_impl.h Outdated Show resolved Hide resolved
@garth-wells garth-wells merged commit 9ca8bbe into main Jun 11, 2022
@garth-wells garth-wells deleted the dokken/flatten-integral-entities branch June 11, 2022 04:38
jorgensd added a commit to jorgensd/dolfinx_mpc that referenced this pull request Jun 13, 2022
jorgensd added a commit to Wells-Group/asimov-custom-assemblers that referenced this pull request Jun 13, 2022
jorgensd added a commit to Wells-Group/asimov-custom-assemblers that referenced this pull request Jun 13, 2022
* Flatten integration entities in C++

Compatible with: FEniCS/dolfinx#2225

* Bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants