HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
Classes and functions to handle boundary conditions and associated numbering of unknowns. More...
Functions | |
void | setBCLabels (const BoundaryConditions &BC, GlobalDOFSpace &globaldofspace) |
Adds BC labels do GlobalDOFSpace DOFs. The default label is 0; we leave it 0 for internal DOF, -1 for Neumann DOF and 1 for Dirichlet DOF. | |
int | offsetIndex (const std::vector< size_t > &c, const int &i) |
Function to offset and index i according to a vector c0,c1,...,c2n of increasing numbers. | |
Eigen::ArrayXi | create_mapDOF (const std::vector< size_t > &c, const size_t N) |
Create a map from DOFs 0..N-1 to values obtained by cutting the DOFs corresponding to c (as per offsetIndex). | |
template<typename VecType > | |
VecType | replaceSectionsVector (const VecType &V, const VecType &Z, const std::vector< std::pair< size_t, size_t > > &sec) |
Replace sections of vector V by values from vector Z into vector V; the sections are determined by 'sec'. The vectors are any (identical) types of Eigen::Vector. | |
Classes and functions to handle boundary conditions and associated numbering of unknowns.
Eigen::ArrayXi create_mapDOF | ( | const std::vector< size_t > & | c, |
const size_t | N | ||
) |
Create a map from DOFs 0..N-1 to values obtained by cutting the DOFs corresponding to c (as per offsetIndex).
int offsetIndex | ( | const std::vector< size_t > & | c, |
const int & | i | ||
) |
Function to offset and index i according to a vector c0,c1,...,c2n of increasing numbers.
The indices between [c0,c1),...[c2n-1,c2n) are removed (return -1), and the other are offset according to this removal
VecType replaceSectionsVector | ( | const VecType & | V, |
const VecType & | Z, | ||
const std::vector< std::pair< size_t, size_t > > & | sec | ||
) |
Replace sections of vector V by values from vector Z into vector V; the sections are determined by 'sec'. The vectors are any (identical) types of Eigen::Vector.
Returns a vector of same length as V, whose segments starting at sec[i].first and with length sec[i].second are replaced using the values (successively) of Z. Can be used to:
1) create a map from DOFs to unknowns: starting from a vector V of -1 of size nb of DOFs and a linearly spaced vector Z of size the number of final unknowns, replaces the -1 by the unknowns. The final vector maps -1 for DOFs that are eliminated (not in the 'sec' positions) and linearly lists unknown numbers for the other DOFs
2) insert, in a vector already containing values for Dirichlet DOFs, values calculated by solving a system on the other DOFs.
void setBCLabels | ( | const BoundaryConditions & | BC, |
GlobalDOFSpace & | globaldofspace | ||
) |
Adds BC labels do GlobalDOFSpace DOFs. The default label is 0; we leave it 0 for internal DOF, -1 for Neumann DOF and 1 for Dirichlet DOF.