| 683 | |
| 684 | template <typename MIP, typename MAT> |
| 685 | static void GenerateMatrix(const FiniteElement &fel, |
| 686 | const MIP &mip, |
| 687 | MAT &&mat, LocalHeap &lh) |
| 688 | { |
| 689 | Mat<D, D> jacobian = mip.GetJacobian(); |
| 690 | Cast(fel).CalcShape(mip.IP(), Trans(mat)); |
| 691 | |
| 692 | // Vec<D> n = ElementTopology::GetNormals<D>(mip.GetTransformation().GetElementType())[mip.IP().FacetNr()]; |
| 693 | // double factor = 1 / L2Norm(Cof(jacobian) * n); |
| 694 | double factor = 1.0 / sqr (Det(jacobian)); |
| 695 | |
| 696 | for (int i = 0; i < fel.GetNDof(); i++) |
| 697 | { |
| 698 | FlatMatrix<> shapei = mat.Col(i).AsMatrix(D, D); |
| 699 | Mat<D,D> trafo_shapei = factor * jacobian * Mat<D,D>(shapei) * Trans(jacobian); |
| 700 | shapei = trafo_shapei; |
| 701 | } |
| 702 | } |
| 703 | }; |
| 704 | |
| 705 | class DiffOpIdHDDFacetBND : public DiffOp<DiffOpIdHDDFacetBND> |