8 template<typename GV, typename MODEL>
9 std::vector<int> setPG(const GV& gv, const MODEL& model, int Nelem){
10 std::vector<int> elemIndx2PG(Nelem);
11 for (
const auto& eit : elements(gv)){
12 int id = gv.indexSet().index(eit);
13 auto point = eit.geometry().center();
14 double layer_cnt=0, inc=0;
16 for(
int i = 0; i < model.num_layers; i++){
17 layer_switch = (i+1)/2 - i/2;
18 inc = model.lay_res_h*layer_switch+(1-layer_switch)*model.lay_com_h;
19 if(point[2] > layer_cnt + 1e-06 && point[2] < layer_cnt + inc + 1.e-06){
20 elemIndx2PG[id] = 1000+i;