/** High Order Finite Element Space for H(Div) */ #include #include namespace ngcomp { using namespace ngcomp; HDivHighOrderFESpace :: HDivHighOrderFESpace (const MeshAccess & ama, const Flags & flags) : FESpace (ama, int (flags.GetNumFlag ("order", 1)), int (flags.GetNumFlag ("dim", 1)), flags.GetDefineFlag ("complex")) { //dimension = 1; low_order_space = 0; //new RaviartThomasFESpace (ma,dimension, iscomplex); rel_order = int (flags.GetNumFlag ("relorder", 0)); segm = new HDivHighOrderNormalSegm(order); if (ma.GetDimension() == 2) { trig = new HDivHighOrderTrig(order); quad = new HDivHighOrderQuad(order); } else { trig = new HDivHighOrderNormalTrig(order); quad = new HDivHighOrderNormalQuad(order); } //quad = new HDivHighOrderQuad (order); tet = new HDivHighOrderTet(order); hex = new HDivHighOrderHex(order); prism = new HDivHighOrderPrism(order); // Evaluator for shape tester if (ma.GetDimension() == 2) { ARRAY coeffs(1); coeffs[0] = new ConstantCoefficientFunction(1); evaluator = GetIntegrators().CreateBFI("masshdiv", 2, coeffs); } else { ARRAY coeffs(1); coeffs[0] = new ConstantCoefficientFunction(1); evaluator = GetIntegrators().CreateBFI("masshdiv", 3, coeffs); boundary_evaluator = GetIntegrators().CreateBFI("robinhdiv", 3, coeffs); } if (dimension > 1) { evaluator = new BlockBilinearFormIntegrator (*evaluator, dimension); boundary_evaluator = new BlockBilinearFormIntegrator (*boundary_evaluator, dimension); } } HDivHighOrderFESpace :: ~HDivHighOrderFESpace () { ; } FESpace * HDivHighOrderFESpace :: Create (const MeshAccess & ma, const Flags & flags) { int order = int(flags.GetNumFlag ("order", 0)); int dim = int(flags.GetNumFlag ("dim", 1)); bool iscomplex = flags.GetDefineFlag ("complex"); if (order == -1) return new RaviartThomasFESpace (ma, dim, iscomplex); // Space with MG else return new HDivHighOrderFESpace (ma, flags); } void HDivHighOrderFESpace :: Update() { cout<<"HDivFeSpace"< Update(); nv = ma.GetNV(); ned = ma.GetNEdges(); nel = ma.GetNE(); nfa = ma.GetNFaces(); // (*testout)<<"nel= "< "< order_face[elfaces[j]]) order_face[elfaces[j]] = elorder; if (elorder > order_inner[i]) order_inner[i] = elorder; } if(1 || order>0) { // face_dof = edge_face_normal_dof + face_normal_dof; first_face_dof.SetSize(nfa+1); int inci = 0; for (i=0; i< nfa; i++) { p = order_face[i]; ma.GetFacePNums(i,pnums); //(*testout)<<"Facenummer "< & dnums) const { if (!eliminate_internal) { GetDofNrs (elnr, dnums); return; } ARRAY vnums, ednums, fnums; int i, j; int first,next; if(order < 0) throw Exception(" HDivHighOrderFESpace :: GetDofNrs() order < 0 "); dnums.SetSize(0); if(ma.GetDimension() == 3) { ma.GetElFaces (elnr, fnums); //Ravier-Thomas for (i = 0; i < fnums.Size(); i++) dnums.Append (fnums[i]); // faces for(i=0; i & dnums) const { ARRAY vnums, ednums, eorient; int fnum,forient; int i, j; int first,next; ma.GetSElEdges (selnr, ednums, eorient); ma.GetSElFace (selnr, fnum, forient); dnums.SetSize(0); if(order <0) throw (" HDivHighOrderFESpace :: GetSDofNrs() order < 0 "); if (ma.GetDimension() == 2) { // RT_0 for (i = 0; i < ednums.Size(); i++) dnums.Append (ednums[i]); //edges_normal for (i = 0; i < ednums.Size(); i++) { first = first_edge_dof[ednums[i]]; next = first_edge_dof[ednums[i]+1]; for (j = first; j 1) { first = first_face_dof[fnum]; next = first_face_dof[fnum+1]; for(j=first; j vnums, ednums, fnums, orient; /* for(i=0; i< nel ; i++) ma.GetElVertices (i, vnums); for(i=0; i< nel; i++) ma.GetElEdges (i,vnums,orient); int pn1,pn2; for(i=0; i< ned; i++) ma.GetEdgePNums (i,pn1,pn2);*/ switch(SmoothingType) { case 1: // RT_0 - Faeod - Iaecd - block (RT_0 - Eaeod - Iaecd - block for 2D) if (ma.GetDimension() == 3) { ncnt = 1 + nfa; if (!eliminate_internal) ncnt += nel; } else { ncnt = 1 + ned; if (!eliminate_internal) ncnt += nel; } break; case 2: // RT_0 - ElFaces -I -block ( - block for 2D) if (ma.GetDimension() == 3) { ncnt = 1 + nel; if (!eliminate_internal) ncnt += nel; } else { ncnt = 1 + ned; if (!eliminate_internal) ncnt += nel; } break; } ARRAY cnt(ncnt); cnt = 0; cout << " ncnt " << ncnt << endl; switch(SmoothingType) { case 1: // RT_0 - Faeod - Iaecd - block (RT_0 - Eaeod - Iaecd - block for 2D) if (ma.GetDimension() == 3) { int i, j, first; cnt[0] = nfa; for (i = 0; i < nfa; i++) cnt[i+1] = first_face_dof[i+1]-first_face_dof[i]; //cnt[i+1] = 1+first_face_dof[i+1]-first_face_dof[i]; if (!eliminate_internal) for (i = 0; i < nel; i++) cnt[nfa+1+i] = first_inner_dof[i+1]-first_inner_dof[i]; Table & table = *new Table (cnt); cnt = 0; for (i = 0; i < nfa; i++) table[0][i] = i; //RT_0 for (i = 0; i < nfa; i++) { //table[i+1][0] = i; //cnt[i+1] = 1; for (j = first_face_dof[i]; j < first_face_dof[i+1]; j++) table[i+1][cnt[i+1]++] = j; } if (!eliminate_internal) for (i = 0; i < nel; i++) { for (j = first_inner_dof[i]; j < first_inner_dof[i+1]; j++) table[nfa+1+i][cnt[nfa+1+i]++] = j; } (*testout) << "smoothingblocks = " << endl << table << endl; return &table; } else { int i, j, first; cnt[0] = ned; for (i = 0; i < ned; i++) cnt[i+1] = 1+first_edge_dof[i+1]-first_edge_dof[i]; if (!eliminate_internal) for (i = 0; i < nel; i++) cnt[nfa+1+i] = first_inner_dof[i+1]-first_inner_dof[i]; Table & table = *new Table (cnt); cnt = 0; for (i = 0; i < ned; i++) table[0][i] = i; //RT_0 for (i = 0; i < ned; i++) { table[i+1][0] = i; cnt[i+1] = 1; for (j = first_edge_dof[i]; j < first_edge_dof[i+1]; j++) table[i+1][cnt[i+1]++] = j; } if (!eliminate_internal) for (i = 0; i < nel; i++) { for (j = first_inner_dof[i]; j < first_inner_dof[i+1]; j++) table[ned+1+i][cnt[ned+1+i]++] = j; } (*testout) << "smoothingblocks = " << endl << table << endl; return &table; } break; case 2: // // RT_0 - ElFaces -I -block ( - block for 2D) if (ma.GetDimension() == 3) { //cout << "cnt = " <