| Base aa4ea8 | Head #4667 c50533 | ||||
|---|---|---|---|---|---|
| Total | Total | +/- | New | ||
| Rate | 66.63% | 66.61% | -0.02% | 100.00% | |
| Hits | 81286 | 81273 | -13 | 38 | |
| Misses | 40709 | 40735 | +26 | 0 | |
| Filename | Stmts | Miss | Cover |
|---|---|---|---|
| include/fe/fe_base.h | +25 | +25 | -9.45% |
| src/fe/fe_base.C | -12 | +1 | -0.50% |
| src/mesh/distributed_mesh.C | 0 | +2 | -0.24% |
| src/mesh/mesh_triangle_holes.C | 0 | -2 | +0.56% |
| TOTAL | +13 | +26 | -0.02% |
codecodecode+
929 930 931 932 + 933 934 935 936 937 + 938 + 939 + 940 941 942 + 943 + 944 945 + 946 + 947 948 + 949 + 950 + 951 952 953 |
* instantiated, such as a dual number type. */ template <typename T> void compute_dual_shape_coefficients (const std::vector<T> & JxW, const std::vector<std::vector<T>> & phi, const std::vector<std::vector<unsigned int>> & vertices, DenseMatrix<T> & coeff) { const unsigned int sz = phi.size(); libmesh_error_msg_if(!sz, "ERROR: cannot compute dual shape coefficients with empty phi values"); libmesh_assert_less_equal(vertices.size(), sz); //compute dual basis coefficient (coeff) coeff.resize(sz, sz); DenseMatrix<T> A(sz, sz), D(sz, sz); for (const auto i : index_range(phi)) for (const auto qp : index_range(phi[i])) { D(i,i) += JxW[qp]*phi[i][qp]; for (const auto j : index_range(phi)) A(i,j) += JxW[qp]*phi[i][qp]*phi[j][qp]; } // The integral positivity condition on the dual basis (Popp, Wohlmuth, Gee and Wall, SIAM J. Sci. |
958 959 960 961 + 962 963 964 + 965 966 + 967 + 968 969 + 970 + 971 972 973 974 975 + 976 977 + 978 + 979 + 980 + 981 982 + 983 + 984 985 + 986 987 988 |
// of its adjacent mid-edge shapes. That replaces D by T^-1 diag(T d), which for this T is the sparse // update below. alpha = 1/5 is recommended there, and makes the weights strictly positive (QUAD8 // 1/5 and 4/5, TRI6 1/15 and 1/10) while preserving the partition of unity. T = I elsewhere. const Real alpha = Real(1)/5; // Mid-edge nodes are the trailing indices, and only vertex entries are written, so D(m,m) here // is never a value an earlier iteration modified. for (const auto k : index_range(vertices)) { const auto m = sz - vertices.size() + k; for (const auto vertex : vertices[k]) { D(vertex, vertex) += alpha*D(m,m); D(vertex, m) -= alpha*D(m,m); } } // coeff = A^-1*D for (const auto j : index_range(phi)) { DenseVector<T> Dcol(sz), coeffcol(sz); for (const auto i : index_range(phi)) Dcol(i) = D(i, j); A.cholesky_solve(Dcol, coeffcol); for (const auto row : index_range(phi)) coeff(row, j)=coeffcol(row); } } } // namespace libMesh |
830 831 832 833 + 834 + 835 + 836 837 838 839 840 + 841 842 843 844 + 845 846 847 + 848 + 849 + 850 + 851 852 + 853 + 854 + 855 856 + 857 858 859 860 |
// Start logging the dual coeff computation LOG_SCOPE("compute_dual_shape_coeffs()", "FE"); const auto vertices = dual_shape_transformed_vertices(_elem, get_fe_type(), phi_vals.size()); compute_dual_shape_coefficients(JxW, phi_vals, vertices, dual_coeff); } std::vector<std::vector<unsigned int>> dual_shape_transformed_vertices (const Elem * elem, const FEType & fe_type, const unsigned int n_shapes) { std::vector<std::vector<unsigned int>> vertices; // SECOND order on TRI7 is the TRI6 basis, with no degree of freedom at the centroid node, and // L2_LAGRANGE shares the LAGRANGE shape functions. if (elem && (fe_type.family == LAGRANGE || fe_type.family == L2_LAGRANGE) && (((elem->type() == TRI6 || elem->type() == TRI7) && n_shapes == 6) || (elem->type() == QUAD8 && n_shapes == 8))) for (const auto m : make_range(elem->n_vertices(), n_shapes)) { auto & adjacent = vertices.emplace_back(); for (const auto v : make_range(elem->n_second_order_adjacent_vertices(m))) adjacent.push_back(elem->second_order_adjacent_vertex(m, v)); } return vertices; } template <> void FEGenericBase<Real>::compute_dual_shape_functions () |
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 |
sender_could_become_owner) { if (it != repartitioned_node_pids.end() && pid < it->second) it->second = pid; else repartitioned_node_pids[n] = pid; } else if (it == repartitioned_node_pids.end()) repartitioned_node_pids[n] = DofObject::invalid_processor_id; repartitioned_node_sets_to_push[pid].insert(n); |
274 275 276 277 278 279 280 281 282 |
// intersections to the right? Try looking to the left. if (!intersection_distances.size()) { ray_target = inside - Point(1); intersection_distances = this->find_ray_intersections(inside, ray_target); } // I'd make this an assert, but I'm not 100% confident we can't |