Domain decomposition methods for gsDomain#851
Draft
hverhelst wants to merge 6 commits into
Draft
Conversation
filiatra
reviewed
Feb 12, 2026
| #include <gsDomain/gsDomain.h> | ||
| #include <gsDomain/gsDomainIterator.h> | ||
| #include <gsCore/gsMultiBasis.h> | ||
| #include <gsCore/gsMultiPatch.h> |
Member
There was a problem hiding this comment.
better move the inclusions in the hpp
| m.derived().resize( rows(), cols() ); | ||
| m.derived().reserve( nonZerosPerFiber() ); | ||
| for (index_t i = 0; i < fibers(); ++i) | ||
| typedef gsEigen::Triplet<T> Triplet; |
Member
There was a problem hiding this comment.
is this always faster?
maybe testing is needed..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TO DO:
This PR adds domain decomposition methods and sub-domain iterators to the
gsDomainmodule.Sub-domain definition for domains (
gsSubDomain,gsTensorSubDomain,gsHSubDomainandgsIndexSubDomain)The
gsTensorSubDomainclass is defined with agsTensorDomainand corners (knot indices) bounding the sub-domain. The domain iterator is optimized to stay in the sub-domain. This class prevents looping over the whole tensor domain and skipping everything outside a specified region (which is sometimes done).The
gsIndexSubDomainclass can be used on any domain to create a sub-domain based on a list of element IDs.NOTE 1: The
gsHSubDomainis unused now, but it could serve as an example to renewgsHDomainusinggsSubTensorDomainfor the leaves.NOTE 2: There is a
gsSubDomainbase class, but I am not sure whether we need it.Decomposition of domains
With the aim to distribute domains over different ranks, the
decomposemethod is implemented. This method provides agsDomain::Ptrby default, but it (almost always) returns agsCompositeDomain.Depending on the type of the domain that is decomposed, the number of pieces to decompose into and the number of elements, we have multiple options:
gsSubTensorDomainorgsTensorDomainis decomposed. The decomposition is provided bygsSubTensorDomainand is done by making axis aligned splits, inspired by domain definition ofgsHTensorBasis.gsHDomainis decomposed. The domain basically consists of a binary tree and multiple sub-tensor domains. Therefore, the size of each leaf is computed and for each leaf it is estimate into how many pieces it should be decomposed. Pieces are then collected in agsCompositeDomain.gsCompositeDomainis decomposed. If the number of patches is larger than the number of pieces to decompose into, the patches are distributed according to Karmarkar Karp merging. If the number of patches is smaller than the number of pieces, every patch is decomposed such that it contains close to the average number of elements needed per piece, then the pieces are distributed over subdomains.Some comments
gsDomainIterator::idandgsDomainIterator::localId. Theidis the ID of the element in the current iterator (e.g. in a sub-domain) andlocalIdis the ID of the element in the parent domain.NEW:
Domain decomposition via
gsDomain::decomposeIMPROVED:
Sub-domain definition and iteration using
gsSubDomainPlease consider the following checklist before issuing a pull
request:
you'd like us to include them?