42 if (BC.
type(*
v)==
"dir"){
44 }
else if (BC.
type(*
v)==
"neu"){
55 if (BC.
type(*e)==
"dir"){
57 }
else if (BC.
type(*e)==
"neu"){
73 assert( c.size() >= 2 && c.size()%2 == 0);
83 offset += c[idx]-c[idx-1];
86 while (idx<
int(c.size()) &&
int(c[idx])<=
i);
97Eigen::ArrayXi
create_mapDOF(
const std::vector<size_t> &c,
const size_t N){
98 assert( c.size() >= 2 && c.size()%2 == 0);
100 Eigen::ArrayXi dofs = Eigen::ArrayXi::LinSpaced(N, 0, N-1);
101 Eigen::ArrayXi map = -Eigen::ArrayXi::Ones(N);
104 map.head(c[0]) = dofs.head(c[0]);
105 for (
size_t i = 1;
i < c.size()-1;
i += 2){
106 offset += c[
i] - c[
i-1];
107 map.segment(c[
i], c[
i+1]-c[
i]) = dofs.segment(c[
i], c[
i+1]-c[
i]) - offset;
109 offset += c[c.size()-1]-c[c.size()-2];
110 map.tail(N-c[c.size()-1]) = dofs.tail(N-c[c.size()-1]) - offset;
128template<
typename VecType>
132 const std::vector<std::pair<size_t,size_t>> &sec
135 assert ( sec[sec.size()-1].first + sec[sec.size()-1].second <=
size_t(V.rows()) );
139 for (
size_t i=0;
i < sec.size();
i++){
140 assert( posZ + sec[
i].second <=
size_t(Z.rows()) );
142 val.segment(sec[
i].first, sec[
i].second) = Z.segment(posZ, sec[
i].second);
143 posZ += sec[
i].second;
The BoundaryConditions class provides definition of boundary conditions.
Definition BoundaryConditions.hpp:45
const std::string type(const Edge &edge) const
Test the boundary condition of an edge.
Definition BoundaryConditions.cpp:41
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition globaldofspace.hpp:16
Compute max and min eigenvalues of all matrices for i
Definition compute_eigs.m:5
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 's...
Definition BChandlers.hpp:129
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,...
Definition BChandlers.hpp:38
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 offse...
Definition BChandlers.hpp:97
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.
Definition BChandlers.hpp:72
void setLabelDOF(const size_t i, const int label)
Set a label to the DOF number i (default label is -1)
Definition globaldofspace.hpp:91
size_t globalOffset(const Vertex &V) const
Return the global offset for the unknowns on the vertex V.
Definition globaldofspace.hpp:31
size_t numLocalDofsVertex() const
Returns the number of local vertex DOFs.
Definition localdofspace.hpp:39
size_t numLocalDofsEdge() const
Returns the number of local edge DOFs.
Definition localdofspace.hpp:45
const Mesh & mesh() const
Returns the mesh.
Definition localdofspace.hpp:33
std::vector< Edge * > get_edges() const
lists the edges in the mesh.
Definition Mesh2D.hpp:76
std::vector< Vertex * > get_vertices() const
lists the vertices in the mesh.
Definition Mesh2D.hpp:75
Definition ddr-klplate.hpp:27
static auto v
Definition ddrcore-test.hpp:32