![]() |
Dune-Fufem 2.11-git
|
Namespaces | |
| namespace | Concept |
| namespace | Experimental |
| namespace | Forms |
Classes | |
| class | AffineConstraints |
| Class to handle affine constraints on a subset of DOFs. More... | |
| class | Barrier |
| A barrier primitive for multi-threaded code. More... | |
| class | Boundary |
| Encapsulate the set of the boundary intersections of a GridView. More... | |
| class | BoundaryData |
| Class for storing data associated to boundary segments. More... | |
| class | BoundaryPatch |
| Encapsulate a subset of the boundary intersections of a GridView. More... | |
| class | CachedFunction |
| Cached evaluation of a function. More... | |
| class | DiscretizationError |
| class | DuneFunctionsBoundaryFunctionalAssembler |
| Generic global assembler for functionals on a boundary. More... | |
| class | DuneFunctionsFunctionalAssembler |
| Generic global assembler for functionals on a gridview. More... | |
| class | DuneFunctionsOperatorAssembler |
| Generic global assembler for operators on a gridview. More... | |
| class | ElementData |
| Class for storing data associated to elements. More... | |
| class | IntersectionSetIterator |
| An iterator iterating over all intersections of an intersection set. More... | |
| struct | IsSingleColumnMatrix |
| Traits class to check if matrix is marked as single column matrix. More... | |
| struct | IsSingleRowMatrix |
| Traits class to check if matrix is marked as single row matrix. More... | |
| class | ISTLMatrixBackend |
| class | LaplaceAssembler |
| Local Laplace (stiffness) assembler for dune-functions basis. More... | |
| struct | Less |
| class | MassAssembler |
| Local mass assembler for dune-functions basis. More... | |
| class | MatrixBuilder |
| Helper class for building matrix pattern. More... | |
| class | MatrixBuilder< Dune::BCRSMatrix< T, A > > |
| Helper class for building matrix pattern. More... | |
| class | MatrixBuilder< Dune::Matrix< Dune::BCRSMatrix< T, A > > > |
| class | MatrixBuilder< MultiTypeBlockMatrix< Row0, Rows... > > |
| Helper class for building matrix pattern. More... | |
| class | MatrixBuilder< NumPyCSRMatrix< T > > |
| Implementation of the MatrixBuilder for NumPyCSRMatrix. More... | |
| struct | NumPyCSRMatrix |
| Struct providing raw storage for a flat CSR matrix using numpy arrays. More... | |
| class | NumPyCSRMatrixBackend |
| Implementation of the MatrixBackend concept NumPyCSRMatrix. More... | |
| class | NumPyVectorBackend |
| Implementation of the VectorBackend concept for numpy vectors. More... | |
| class | SubEntityQuadratureRule |
| Quadrature rule for a subentity of some given geometry type. More... | |
| class | SymmetricMatrix |
| A class implementing a symmetric matrix with compile-time size. More... | |
Typedefs | |
| template<class Base > | |
| using | SingleRowMatrix = Dune::Assembler::SingleRowMatrix< Base > |
| Tag matrix as single row matrix. | |
| template<class Base > | |
| using | SingleColumnMatrix = Dune::Assembler::SingleColumnMatrix< Base > |
| Tag matrix as single column matrix. | |
Functions | |
| template<class TestBasis , class BP > | |
| auto | duneFunctionsBoundaryFunctionalAssembler (const TestBasis &testBasis, const BP &bp) |
| Create DuneFunctionsBoundaryFunctionalAssembler. | |
| template<class TestBasis > | |
| auto | duneFunctionsFunctionalAssembler (const TestBasis &testBasis) |
| Create DuneFunctionsFunctionalAssembler. | |
| template<class TestBasis , class AnsatzBasis > | |
| auto | duneFunctionsOperatorAssembler (const TestBasis &testBasis, const AnsatzBasis &ansatzBasis) |
| Create DuneFunctionsOperatorAssembler. | |
| template<class Entry , class Matrix > | |
| auto | istlMatrixBackend (Matrix &matrix) |
| template<class Matrix > | |
| auto | istlMatrixBackend (Matrix &matrix) |
| template<class RowBasis , class ColBasis , class M > | |
| decltype(auto) | toConstMatrixBackend (M &m) |
Return a ConstMatrixBackend for given matrix. | |
| template<class RowBasis , class ColBasis , class M > | |
| decltype(auto) | toMatrixBackend (M &m) |
Return a MatrixBackend for given matrix. | |
| template<class BitVector = std::monostate, class Vector = std::monostate, class Basis > | |
| auto | makeAffineConstraints (const Basis &basis) |
Create and initialize an AffineConstraints object for a basis. | |
| template<class BV , class V , class MI , class C , class Basis , class Function , class IntersectionSet > requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value) | |
| void | computeBoundaryConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, Function &&f, const IntersectionSet &intersectionSet) |
| Compute constraints for essential boundary conditions. | |
| template<class BV , class V , class MI , class C , class Basis , class Function > | |
| void | computeBoundaryConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, Function &&f) |
| Compute constraints for essential boundary conditions. | |
| template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function , class IntersectionSet > requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value) | |
| auto | makeBoundaryConstraints (const Basis &basis, Function &&f, const IntersectionSet &intersectionSet) |
| Compute constraints for essential boundary conditions. | |
| template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function > | |
| auto | makeBoundaryConstraints (const Basis &basis, Function &&f) |
| Compute constraints for essential boundary conditions. | |
| template<class BV , class V , class MI , class C , class Basis > | |
| void | computeContinuityConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis) |
| Compute constraints for a conforming basis on a grid with hanging nodes. | |
| template<class BitVector = std::monostate, class Vector = std::monostate, class Basis > | |
| auto | makeContinuityConstraints (const Basis &basis) |
| Compute constraints for a conforming basis on a grid with hanging nodes. | |
| template<class PrimaryLocalView , class SecondaryLocalView , class SecondaryToPrimary , class SecondaryDOFs , class Constraints > | |
| void | computeLocalInterpolationConstraints (const PrimaryLocalView &primaryLocalView, const SecondaryLocalView &secondaryLocalView, const SecondaryToPrimary &localSecondaryToPrimary, const SecondaryDOFs &secondaryDOFs, Constraints &constraints) |
| Compute local constraints from interpolating between local views. | |
| template<class BV , class V , class MI , class C , class PrimaryBasis , class PrimaryPatch , class SecondaryBasis , class SecondaryPatch , class SecondaryToPrimary > | |
| void | computePeriodicConstraints (AffineConstraints< BV, V, MI, C > &constraints, const PrimaryBasis &primaryBasis, const PrimaryPatch &primaryPatch, const SecondaryBasis &secondaryBasis, const SecondaryPatch &secondaryPatch, const SecondaryToPrimary &secondaryToPrimary) |
| Compute constraints for periodic boundary conditions. | |
| template<class BV , class V , class MI , class C , class Basis , class PrimaryPatch , class SecondaryPatch , class SecondaryToPrimary > | |
| void | computePeriodicConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, const PrimaryPatch &primaryPatch, const SecondaryPatch &secondaryPatch, const SecondaryToPrimary &secondaryToPrimary) |
| Compute constraints for periodic boundary conditions. | |
| template<class FT , class D > | |
| CachedFunction (FT &&f, Dune::MetaType< D > md) -> CachedFunction< std::decay_t< FT >, D > | |
| template<class Range = double, class Vector = std::monostate, class Basis > | |
| void | writeBasis (const Basis &basis, std::string name, int order=-1) |
| Write basis functions as vtk-sequence. | |
| template<class Range = double, class Vector = std::monostate, class Basis , class Constraints > | |
| void | writeBasis (const Basis &basis, std::string name, const Constraints &constraints, int order=-1) |
| Write basis functions of constrained space as vtk-sequence. | |
| template<class IntersectionSet , class Basis , class Vector > requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value) | |
| void | markIntersectionDofs (const IntersectionSet &intersectionSet, const Basis &basis, Vector &vector) |
| For a given basis and intersection set, determine all degrees of freedom on the patch. | |
| template<class GridView , class Basis , class Vector > | |
| void | markBoundaryPatchDofs (const BoundaryPatch< GridView > &boundaryPatch, const Basis &basis, Vector &vector) |
| For a given basis and boundary patch, determine all degrees of freedom on the patch. | |
| template<class Basis , class Vector > | |
| void | markBoundaryDofs (const Basis &basis, Vector &vector) |
| For a given basis determine all degrees of freedom on the boundary. | |
| template<class Grid > | |
| BoundaryData (const Dune::GmshReader< Grid > &, const Dune::GridFactory< Grid > &, const Grid &) -> BoundaryData< int > | |
| template<class GridView > | |
| ElementData (const Dune::GmshReader< typename GridView::Grid > &, const Dune::GridFactory< typename GridView::Grid > &, const GridView &) -> ElementData< GridView, int > | |
| template<class Grid > | |
| ElementData (const Dune::GmshReader< Grid > &, const Dune::GridFactory< Grid > &, const Grid &) -> ElementData< typename Grid::LeafGridView, int > | |
| template<class Permutation , class DataContainer > | |
| void | permuteInplace (const Permutation &permutation, DataContainer &data) |
| Apply inplace permutation to container. | |
| template<class GridFactory , class Grid > | |
| std::vector< std::size_t > | boundarySegmentInsertionIndices (const GridFactory &gridFactory, const Grid &grid) |
| Compute permutation of boundary segments. | |
| template<class GridFactory , class Grid , class Container > | |
| void | permuteFromBoundarySegmentInsertionIndices (const GridFactory &gridFactory, const Grid &grid, Container &data) |
| Permute container according to boundary segment permutation. | |
| template<class Duration = std::chrono::duration<double>> | |
| auto | makeLogger (std::ostream &stream, std::string format) |
| Create a simple logger callback. | |
| template<class Duration = std::chrono::duration<double>> | |
| auto | makeSynchronizedLogger (std::ostream &stream, std::string format, std::mutex &mutex) |
| Create a simple logger callback. | |
| template<class Adjacency , class SeedNodesContainer > | |
| auto | computeColoring (const Adjacency &adjacency, SeedNodesContainer &&seedNodes) |
| Compute a graph coloring from neighboring information. | |
| template<class Adjacency , class T > | |
| auto | computeColoring (const Adjacency &adjacency, std::initializer_list< T > seedIndices) |
| Compute a graph coloring from neighboring information. | |
| template<class Adjacency > | |
| auto | computeColoring (const Adjacency &adjacency) |
| Compute a graph coloring from neighboring information. | |
| template<class CliqueList > | |
| auto | cliqueListToAdjacency (const CliqueList &cliqueList, std::size_t size, bool verbose=false) |
| Compute an adjacency list from a clique list. | |
| template<class GridView , class ElementMapper , class size_type = uint32_t> | |
| auto | vertexBasedElementAdjacency (const GridView &gridView, const ElementMapper &elementMapper, bool verbose=false) |
| Compute a vertex based adjacency list. | |
| template<class GridView , class size_type = uint32_t> | |
| auto | vertexBasedElementAdjacency (const GridView &gridView, bool verbose=false) |
| Compute a vertex based element adjacency list. | |
| template<class GridView , class SubEntityLayout , class ElementMapper , class size_type = uint32_t> | |
| auto | subEntityBasedElementAdjacency (const GridView &gridView, const SubEntityLayout &subEntityLayout, const ElementMapper &elementMapper) |
| Compute a layout based adjacency list. | |
| template<class GridView , class SubEntityLayout , class size_type = uint32_t> | |
| auto | subEntityBasedElementAdjacency (const GridView &gridView, const SubEntityLayout &subEntityLayout) |
| Compute a layout based element adjacency list. | |
| template<class GridView , class size_type > | |
| auto | coloredGridViewPartition (const GridView &gridView, const std::vector< size_type > &coloring) |
| Compute a colored partition of the elements in the gridView from coloring. | |
| template<class GridView , class size_type = uint32_t> | |
| auto | coloredGridViewPartition (const GridView &gridView, bool verbose=false) |
| Compute a colored partition of the elements in the gridView. | |
| template<class ElementRange , class Basis > | |
| bool | checkOverlapFree (const ElementRange &elementRange, const Basis &basis) |
| Check if given element range is overlap free. | |
| template<class Range > | |
| static auto | rangeSegment (Range &range, std::size_t i, std::size_t n) |
| Split range into uniform segments. | |
| template<class F > | |
| void | parallelAlgorithm (std::size_t threadCount, F &&threadImp) |
| Utility for implementing parallel algorithms based on colored entity partitions. | |
Typedef Documentation
◆ SingleColumnMatrix
| using Dune::Fufem::SingleColumnMatrix = typedef Dune::Assembler::SingleColumnMatrix<Base> |
Tag matrix as single column matrix.
- Template Parameters
-
Base The base matrix type that should be tagged.
This class helps to solve the problem, that the distribution of digits from non-uniform row- and column-multi-indices to the different levels of a nested matrix cannot be done generically.
The reason for this problem is, that all matrices in Dune need a row and a column index to access their entries. Hence, for a nested matrix the row and column multi-index always need to have the same length. However, there are natural applications of multi-indices with non-uniform length (e.g. for the Stokes problem). In this case it is implicitly assumed that for certain matrices in the nested matrix hierarchy only a column or row index is provided. In practice this means, you need to insert a zero-digit at the correct position in the complementary multi-index. Unfortunately, this cannot be done automatically, because there are many candidates for this position and it's in fact a user choice, which one is correct.
To solve this, one can tag a matrix type M as single-column by using SingleColumnMatrix<M> instead. Then the algorithm for dispatching multi-indices knows, that it has to insert a zero digit into the column multi-index here.
The class derives from Base and inherits all its members without overwriting any and can thus be used as a replacement for Base.
- Deprecated:
- This typedef is deprecated and will be removed after 2.11. Use
Dune::Assembler::SingleRowMatrixinstead.
◆ SingleRowMatrix
| using Dune::Fufem::SingleRowMatrix = typedef Dune::Assembler::SingleRowMatrix<Base> |
Tag matrix as single row matrix.
- Template Parameters
-
Base The base matrix type that should be tagged.
This class helps to solve the problem, that the distribution of digits from non-uniform row- and column-multi-indices to the different levels of a nested matrix cannot be done generically.
The reason for this problem is, that all matrices in Dune need a row and a column index to access their entries. Hence, for a nested matrix the row and column multi-index always need to have the same length. However, there are natural applications of multi-indices with non-uniform length (e.g. for the Stokes problem). In this case it is implicitly assumed that for certain matrices in the nested matrix hierarchy only a column or row index is provided. In practice this means, you need to insert a zero-digit at the correct position in the complementary multi-index. Unfortunately, this cannot be done automatically, because there are many candidates for this position and it's in fact a user choice, which one is correct.
To solve this, one can tag a matrix type Base as single-row by using SingleRowMatrix<Base> instead. Then the algorithm for dispatching multi-indices knows, that it has to insert a zero digit into the row multi-index here.
The class derives from Base and inherits all its members without overwriting any and can thus be used as a replacement for Base.
- Deprecated:
- This typedef is deprecated and will be removed after 2.11. Use
Dune::Assembler::SingleRowMatrixinstead.
Function Documentation
◆ BoundaryData()
| Dune::Fufem::BoundaryData | ( | const Dune::GmshReader< Grid > & | , |
| const Dune::GridFactory< Grid > & | , | ||
| const Grid & | |||
| ) | -> BoundaryData< int > |
◆ boundarySegmentInsertionIndices()
| std::vector< std::size_t > Dune::Fufem::boundarySegmentInsertionIndices | ( | const GridFactory & | gridFactory, |
| const Grid & | grid | ||
| ) |
Compute permutation of boundary segments.
This computes the permutation from boundary segment index as provided by the grid to insertion index as provided by the gridFactory. The result is returned as vector of insertion indices ordered by boundary segment indices.
- Parameters
-
gridFactory The factory the grid was created with grid The grid
- Returns
- A std::vector<std::size_t> mapping boundarySegmentIndex to insertionIndex
◆ CachedFunction()
| Dune::Fufem::CachedFunction | ( | FT && | f, |
| Dune::MetaType< D > | md | ||
| ) | -> CachedFunction< std::decay_t< FT >, D > |
◆ checkOverlapFree()
| bool Dune::Fufem::checkOverlapFree | ( | const ElementRange & | elementRange, |
| const Basis & | basis | ||
| ) |
Check if given element range is overlap free.
The function exists for debugging purposes: It checks if the given elementRange is overlap free in the sense that for any pair of elements in the range, the set of associated global indices in the given basis is disjoint. The function will print out diagnostic information if an overlap is detected.
- Returns
- True is no overlap is detected, otherwise false.
◆ cliqueListToAdjacency()
| auto Dune::Fufem::cliqueListToAdjacency | ( | const CliqueList & | cliqueList, |
| std::size_t | size, | ||
| bool | verbose = false |
||
| ) |
Compute an adjacency list from a clique list.
This will construct the adjacency list of the graph induced by the clique list, i.e. the minimal graph containing all given cliques. Notice that a clique of a graph is a complete subgraph. The clique list is provided as a range of ranges: Each entry in the outer range models a clique. Each clique is represented by a range of vertex indices. For a given range cliqueList the resulting graph will have an edge (i,j) iff there is a clique k, such that cliqueList[k] contains i and j.
The created graph is returned as adjacency list in the form of a range of ranges.
If the verbose mode is enabled, this computes and prints out the number of the largest clique which is a lower bound for the chromatic number of the graph (i.e. the minimal number of colores required in a coloring).
- Parameters
-
cliqueList Range of cliques to be added to the graph size Number of nodes in the graph. verbose Flag to enable verbose mode (default=false)
◆ coloredGridViewPartition() [1/2]
| auto Dune::Fufem::coloredGridViewPartition | ( | const GridView & | gridView, |
| bool | verbose = false |
||
| ) |
Compute a colored partition of the elements in the gridView.
This is a short cut that subsequently computes a vertex based adjacency list for the elements in the grid view, a coloring for the induced element graph, and finally the resulting colored element partition of the grid view. The exact return type is explained in the documentation of coloredGridViewPartition(). If verbose mode is used, timing of each operation are printed to std::cout.
This colors the element graph G, where two elements are connected if they share a vertex. Notice that the resulting coloring is quasi-optimal in the sense that the number of used colors C is bounded by C <= 1+chi(G)2^d where chi(G) is the chromatic number (i.e. the optimal number of colors):
Assume that the number of colors used by the algorithm is C. By construction the algorithm guarantees C<=1+Delta(G) where Delta(G) is the maximal nodal degree of G. Now let k the maximal number of elements sharing a vertex. Then k is a lower bound for the clique number omega(G) (i.e. the size of largest fully connected subgraph) and thus for the chromatic number chi(G) (i.e. the optimal number of colors). Each element has at most 2^d vertices and thus at most k2^d neighbors, i.e. we have Delta(G) <= k2^d. Finally we arrive at k <= omega(G) <= chi(G) <= C <= Delta(G)+1 <= 1+k2^d and hence C <= 1+chi(G)2^d <= chi(G)(2^d+1).
Notice that even for planar 2d grids the element graph is not planar and thus we may need more than 4 colors.
- Template Parameters
-
size_type Type used to store indices (default=uint32_t)
- Parameters
-
gridView The grid view to partition verbose Flag to enable verbose mode (default=false)
- Returns
- Partition of elements into chucks represented by std::vector<ElementRange>
◆ coloredGridViewPartition() [2/2]
| auto Dune::Fufem::coloredGridViewPartition | ( | const GridView & | gridView, |
| const std::vector< size_type > & | coloring | ||
| ) |
Compute a colored partition of the elements in the gridView from coloring.
This computes a vector containing one element range per color. Each element range is a range all elements from the gridView that share the respective color. Hence the outer size is the number of used colors, while the sum of the inner sizes is the total number of elements in the gridView. Internally each element range is stored as std::vector<EntitySeed> and stored EntitySeeds are transformed to Entities on the fly during traversal.
- Parameters
-
gridView GridView whose elements should be distributed coloring A std::vector<size_type> representing a coloring as provided by computeColoring()
- Returns
- Partition of elements into chucks represented by std::vector<ElementRange>
◆ computeColoring() [1/3]
| auto Dune::Fufem::computeColoring | ( | const Adjacency & | adjacency | ) |
Compute a graph coloring from neighboring information.
This computes a coloring for a set of nodes with given neighboring relation using a simple greedy advancing front algorithm.
The input graph is represented as follows: Each node corresponds to an index. These indices are zero-based, consecutive, and stored as size_type. The adjacency of the graph is passed as an adjacency list which has to be provided as a range of ranges. Where, for a node index i, adjacency[i] is the range of indices of neighboring nodes. While the outer range must be a random access range providing a size() method, the inter ranges only need to be forward ranges.
The algorithm initializes a queue with the seed node 0. In an advancing front sweep the algorithm processes entries from the queue until it is empty. Each entry is colored with the next free color not used by any of it's neighbors, followed by adding all non-processed neighbors to the queue.
If the queue is empty, the first non-processed node is searched and added to the queue to start the next sweep. This is done until there are no non-processed nodes left.
The number of needed sweeps corresponds to the number of connected components in the graph. If there are many connected components the search for non-processed noded can be avoided, by passing a container with seed nodes as additional argument.
- Parameters
-
adjacency Adjacency list of the graph
- Returns
- A std::vector<size_type> containing the color of each node index
◆ computeColoring() [2/3]
| auto Dune::Fufem::computeColoring | ( | const Adjacency & | adjacency, |
| SeedNodesContainer && | seedNodes | ||
| ) |
Compute a graph coloring from neighboring information.
This computes a coloring for a set of nodes with given adjacency using a simple greedy advancing front algorithm.
The input graph is represented as follows: Each node corresponds to an index. These indices are zero-based, consecutive, and stored as size_type. The adjacency of the graph is passed as an adjacency list which has to be provided as a range of ranges. Where, for a node index i, adjacency[i] is the range of indices of neighboring nodes. While the outer range must be a random access range providing a size() method, the inter ranges only need to be forward ranges.
This overload allows to additionally pass a container of seed nodes. The algorithm is the same as for the overload without this argument, but the internal queue is initialized with the given seed nodes instead of 0. This may improve performance if there are many connected components. Passing an empty container leads to the same behaviour as passing none.
- Parameters
-
adjacency Adjacency list of the graph seedNodes Container with seed nodes to be used for advancing front method.
- Returns
- A std::vector<size_type> containing the color of each node index
◆ computeColoring() [3/3]
| auto Dune::Fufem::computeColoring | ( | const Adjacency & | adjacency, |
| std::initializer_list< T > | seedIndices | ||
| ) |
Compute a graph coloring from neighboring information.
This computes a coloring for a set of nodes with given adjacency using a simple greedy advancing front algorithm.
The input graph is represented as follows: Each node corresponds to an index. These indices are zero-based, consecutive, and stored as size_type. The adjacency of the graph is passed as an adjacency list which has to be provided as a range of ranges. Where, for a node index i, adjacency[i] is the range of indices of neighboring nodes. While the outer range must be a random access range providing a size() method, the inter ranges only need to be forward ranges.
This overload allows to additionally pass a container of seed nodes using a braced initializer list. It stores the entries in a std::vector and forwards this to the overload with templated SeedNodesContainer.
- Parameters
-
adjacency Adjacency list of the graph seedNodes std::initializer_list with seed nodes to be used for advancing front method.
- Returns
- A std::vector<size_type> containing the color of each node index
◆ duneFunctionsBoundaryFunctionalAssembler()
| auto Dune::Fufem::duneFunctionsBoundaryFunctionalAssembler | ( | const TestBasis & | testBasis, |
| const BP & | bp | ||
| ) |
Create DuneFunctionsBoundaryFunctionalAssembler.
- Deprecated:
- This function is deprecated and will be removed after 2.11. Use the global assemblers from the dune-assember module together with Dune::Fufem::Forms based local assemblers instead.
◆ duneFunctionsFunctionalAssembler()
| auto Dune::Fufem::duneFunctionsFunctionalAssembler | ( | const TestBasis & | testBasis | ) |
Create DuneFunctionsFunctionalAssembler.
- Deprecated:
- This function is deprecated and will be removed after 2.11. Use the global assemblers from the dune-assember module together with Dune::Fufem::Forms based local assemblers instead.
◆ duneFunctionsOperatorAssembler()
| auto Dune::Fufem::duneFunctionsOperatorAssembler | ( | const TestBasis & | testBasis, |
| const AnsatzBasis & | ansatzBasis | ||
| ) |
Create DuneFunctionsOperatorAssembler.
- Deprecated:
- This function is deprecated and will be removed after 2.11. Use the global assemblers from the dune-assember module together with Dune::Fufem::Forms based local assemblers instead.
◆ ElementData() [1/2]
| Dune::Fufem::ElementData | ( | const Dune::GmshReader< Grid > & | , |
| const Dune::GridFactory< Grid > & | , | ||
| const Grid & | |||
| ) | -> ElementData< typename Grid::LeafGridView, int > |
◆ ElementData() [2/2]
| Dune::Fufem::ElementData | ( | const Dune::GmshReader< typename GridView::Grid > & | , |
| const Dune::GridFactory< typename GridView::Grid > & | , | ||
| const GridView & | |||
| ) | -> ElementData< GridView, int > |
◆ istlMatrixBackend() [1/2]
- Deprecated:
- This function is deprecated and will be removed after 2.11. Use the
ISTLMatrixBackendfrom the dune-assember module instead.
◆ istlMatrixBackend() [2/2]
- Deprecated:
- This function is deprecated and will be removed after 2.11. Use the
ISTLMatrixBackendfrom the dune-assember module instead.
◆ makeLogger()
| auto Dune::Fufem::makeLogger | ( | std::ostream & | stream, |
| std::string | format | ||
| ) |
Create a simple logger callback.
- Template Parameters
-
Duration An instance of std::chrono::duration used for printing the time stamps, defaults to std::chrono::duration<double>
- Parameters
-
stream The ostream this logger writes to format The format string used for formatting the time stamp data
This will create a logger object that can be used to print strings to the given stream. Each string is prepended with a time stamp of the total time elapsed since the logger was created and the time that evolved since printing the last log message. Both are formatted using the (printf-style) format string used when creating the logger.
The Duration parameter can be used for selecting the representation of time stamps. The default is to represent seconds as double. By passing std::chrono::milliseconds this can e.g. be changed to represent milliseconds as integers. Notice that the format string should match the representation type.
◆ makeSynchronizedLogger()
| auto Dune::Fufem::makeSynchronizedLogger | ( | std::ostream & | stream, |
| std::string | format, | ||
| std::mutex & | mutex | ||
| ) |
Create a simple logger callback.
- Template Parameters
-
Duration An instance of std::chrono::duration used for printing the time stamps, defaults to std::chrono::duration<double>
- Parameters
-
stream The ostream this logger writes to format The format string used for formatting the time stamp data mutex A global mutex used for synchronization.
This allows to create a logger similar to makeLogger but synchronized using a std::mutex for writing from concurrent streams. The mutex protects any access to the stream, such that concurrent streams can either use the same logger or different loggers using the same mutex.
◆ parallelAlgorithm()
| void Dune::Fufem::parallelAlgorithm | ( | std::size_t | threadCount, |
| F && | threadImp | ||
| ) |
Utility for implementing parallel algorithms based on colored entity partitions.
- Parameters
-
threadCount The number of threads to create threadImp The callback implementing the thread
This will create threadCount copies of threadImp, one for each thread. For each thread it will execute the respective copy of threadImp passing a callback object parallelAlgorithmHelper to it. This can e.g. be used to do a parallel loop over a range using parallelAlgorithmHelper.forEach(range,f) or parallel loops over each color in a colored partition of a range using parallelAlgorithmHelper.coloredForEach(partition,f). More precisely calling this in a thread will do an outer loop over all colors from the partition. For each color it will execute an inner loop over the range of entries from the current color that have been assigned to the thread and pass them to f. Every time the inner loop has finished all threads will be synchronized with a barrier.
This requires that the partition passed to coloredForEach() is overlap-free with respect to f, in the sense that parallel calls of f for different entities of the same color do not create race conditions. Furthermore the additional code in the threads must also not contain race conditions. Then the whole algorithm can safely be executed in parallel. Attention: Remember to always capture data that should be thread-local by value in threadImp. Otherwise concurrent threads will access a single instance of this data.
Example: Assume that accessElementData(entity) writes some date associated to the entity and that the partition is overlap-free wrt this function. Then a parallel algorithm can e.g. take the form
parallelAlgorithm(threadCount, [&, threadLocalData](auto&& parallel) { doSomeSetupForThisThread(); parallel.coloredForEach(partition, [&](const auto& entity) { accessElementData(entity); }); parallel.barrier().arrive_and_wait(); if (parallel.threadIndex() == 1) std::cout << "Hello from thread 1!" << std::endl; parallel.barrier().arrive_and_wait(); doSomeParallelComputation(); parallel.barrier().arrive_and_wait(); doSomeMoreParallelComputation(); });
◆ permuteFromBoundarySegmentInsertionIndices()
| void Dune::Fufem::permuteFromBoundarySegmentInsertionIndices | ( | const GridFactory & | gridFactory, |
| const Grid & | grid, | ||
| Container & | data | ||
| ) |
Permute container according to boundary segment permutation.
This will permute the entries of a container index by insertion indices, to the ordering corresponidng to boundary segment indices. The permutation is applied in-place using std::swap.
Notice that this first computes the permutation, then applies it to the container, and finally discards it. Hence, if you want to permute several containers, it is more efficient to compute and store the permutation while applying the in-place permutation manually using Dune::Fufem::permuteInplace().
- Parameters
-
gridFactory The factory the grid was created with grid The grid data The container to permute. Must support std::swap.
◆ permuteInplace()
| void Dune::Fufem::permuteInplace | ( | const Permutation & | permutation, |
| DataContainer & | data | ||
| ) |
Apply inplace permutation to container.
This permutes the entries of the data container according to the given permutation using subsequent calls to std::swap such that data[k] contains the former entry of data[permutation[k]]. I.e. the permutation is assumed to store for each new index the corresponding old index.
- Parameters
-
permutation Index permutation data Data container that should be permuted
◆ rangeSegment()
|
static |
Split range into uniform segments.
Given a range, this returns a range-view of the i-th of n contiguous subranges of approximately the same size range.size()/n. To ensure that this is O(1) the passed range should provide random access iterators.
- Parameters
-
range The (random access) range that should be split i Index of this segment n Number of segments
- Returns
- A view given by Dune::IteratorRange
◆ subEntityBasedElementAdjacency() [1/2]
| auto Dune::Fufem::subEntityBasedElementAdjacency | ( | const GridView & | gridView, |
| const SubEntityLayout & | subEntityLayout | ||
| ) |
Compute a layout based element adjacency list.
This identifies each element with its index in terms of a MultipleCodimMultipleGeomTypeMapper(..., mcmgElementLayout()) and returns the corresponding adjacency list.
Elements are considered to be neighbors if they share a subentity that is enabled by the given layout callback. The callback models the interface of the MultipleCodimMultipleGeomTypeMapper.
The produced adjacency list corresponds to a graph where grid element chunks are the nodes and subenitites are edges between adjacent element chunks.
- Template Parameters
-
size_type Type used to store indices (default=uint32_t)
- Parameters
-
gridView The underlying grid view subEntityLayout Layout class to select subentities
◆ subEntityBasedElementAdjacency() [2/2]
| auto Dune::Fufem::subEntityBasedElementAdjacency | ( | const GridView & | gridView, |
| const SubEntityLayout & | subEntityLayout, | ||
| const ElementMapper & | elementMapper | ||
| ) |
Compute a layout based adjacency list.
This uses a mapper to map elements to an index and returns the corresponding adjacency list. The mapper must provide elementMapper.index(element) and elementMapper.size() methods. It is allowed to map several elements to the same index. Then all elements sharing an index are treated as a element chunks.
Element chunks are considered to be neighbors if they share a subentity that is enabled by the given layout callback. The callback models the interface of the MultipleCodimMultipleGeomTypeMapper.
The produced adjacency list corresponds to a graph where grid element chunks are the nodes and subenitites are edges between adjacent element chunks.
- Template Parameters
-
size_type Type used to store indices (default=uint32_t)
- Parameters
-
gridView The underlying grid view subEntityLayout Layout class to select subentities elementMapper A mapper associating elements to indices
◆ toConstMatrixBackend()
| decltype(auto) Dune::Fufem::toConstMatrixBackend | ( | M & | m | ) |
Return a ConstMatrixBackend for given matrix.
This returns a ConstMatrixBackend for the given matrix object suitable to be accessed using the multi-indices of the provided basis types.
If the passed matrix object already satisfies the ConstMatrixBackend concept, it is forwarded, otherwise it is wrapped using Dune::Fufem::istlMatrixBackend(...). Thus the return type should always be captured using either const auto& or auto&&.
Warning: You must not pass temporaries to this method.
- Template Parameters
-
RowBasis Basis type for row indices ColBasis Basis type for column indices
- Parameters
-
m Matrix to be accessed using basis indices.
- Deprecated:
- This function is deprecated and will be removed after 2.11.
◆ toMatrixBackend()
| decltype(auto) Dune::Fufem::toMatrixBackend | ( | M & | m | ) |
Return a MatrixBackend for given matrix.
This returns a MatrixBackend for the given matrix object suitable to be accessed using the multi-indices of the provided basis types.
If the passed matrix object already satisfies the MatrixBackend concept, it is forwarded, otherwise it is wrapped using Dune::Fufem::istlMatrixBackend(...). Thus the return type should always be captured using either const auto& or auto&&.
Warning: You must not pass temporaries to this method.
- Template Parameters
-
RowBasis Basis type for row indices ColBasis Basis type for column indices
- Parameters
-
m Matrix to be accessed using basis indices.
- Deprecated:
- This function is deprecated and will be removed after 2.11.
◆ vertexBasedElementAdjacency() [1/2]
| auto Dune::Fufem::vertexBasedElementAdjacency | ( | const GridView & | gridView, |
| bool | verbose = false |
||
| ) |
Compute a vertex based element adjacency list.
This identifies each element with its index in terms of a MultipleCodimMultipleGeomTypeMapper(..., mcmgElementLayout()) and returns the corresponding adjacency list.
Elements are considered to be neighbors if they share a vertex. Notice that this automatically includes the case that elements share a subentity of any codimension.
The produced adjacency list corresponds to a graph where grid elements are the nodes and grid vertices are edges between adjacent elements. This is similar to, but not identical to the dual graph of the grid, because the latter only considers elements with shared facets as neighbors.
If the verbose mode is enabled, this computes and prints out the number of the largest found clique in the element graph which is a lower bound for the chromatic number of the graph (i.e. the minimal number of colores required in a coloring).
- Template Parameters
-
size_type Type used to store indices (default=uint32_t)
- Parameters
-
gridView The underlying grid view verbose Flag to enable verbose mode (default=false)
◆ vertexBasedElementAdjacency() [2/2]
| auto Dune::Fufem::vertexBasedElementAdjacency | ( | const GridView & | gridView, |
| const ElementMapper & | elementMapper, | ||
| bool | verbose = false |
||
| ) |
Compute a vertex based adjacency list.
This uses a mapper to map elements to an index and returns the corresponding adjacency list. The mapper must provide elementMapper.index(element) and elementMapper.size() methods. It is allowed to map several elements to the same index. Then all elements sharing an index are treated as a element chunks.
Element chunks are considered to be neighbors if they share a vertex. Notice that this automatically includes the case that elements share a subentity of any codimension.
The produced adjacency list corresponds to a graph where grid element chunks are the nodes and grid vertices are edges between adjacent element chunks.
If the verbose mode is enabled, this computes and prints out the number of the largest found clique in the element graph which is a lower bound for the chromatic number of the graph (i.e. the minimal number of colores required in a coloring).
- Template Parameters
-
size_type Type used to store indices (default=uint32_t)
- Parameters
-
gridView The underlying grid view elementMapper A mapper associating elements to indices verbose Flag to enable verbose mode (default=false)
