13 std::array<chi_mesh::Vector3, 4> &radii_vectors_xy_tilde,
14 std::array<double,4>& sub_sub_sqr_areas)
16 auto& SA_i = sub_sub_sqr_areas;
21 radii_vectors_xy_tilde, sq, legendre);
22 double d = 1.0/sqrt(3.0);
24 double epsilon = 1.0e-1;
29 auto weights = ComputeWeights(rho);
32 Chi::log.
Log() <<
"=================================================== ";
33 for (
int k=0; k<150; ++k)
39 auto weights_offset_pos = ComputeWeights(rho + delta);
40 auto weights_offset_neg = ComputeWeights(rho - delta);
42 double rho_change_total = 0.0;
43 for (
int i=0; i<4; ++i)
46 slope += 0.5*(weights_offset_pos[i]-weights[i]);
47 slope -= 0.5*(weights_offset_neg[i]-weights[i]);
48 drho_df[i] = delta[i]/slope;
50 double delta_rho = 1.0*drho_df[i]*(SA_i[i] - weights[i]);
60 rho[i] = std::fmax(0.0,rho[i]);
61 rho[i] = std::fmin(1.0,rho[i]);
62 rho_change_total -= 1.0*drho_df[i]*(weights[i]-SA_i[i]);
66 weights = ComputeWeights(rho);
68 for (
int i=0; i<4; ++i)
69 change = std::fabs((weights[i] - SA_i[i])/weights[i]);
90 if (rho_change_total < 1.0e-2)
break;
99 weights = ComputeWeights(rho);
101 for (
int i=0; i<4; ++i)
103 auto xy_tilde = sq_xy_tilde_centroid +
104 rho[i]*radii_vectors_xy_tilde[i];
LogStream Log(LOG_LVL level=LOG_0)
void IsolatedQPOptimization(SphericalQuadrilateral &sq, chi_math::QuadratureGaussLegendre &legendre, chi_mesh::Vertex &sq_xy_tilde_centroid, std::array< chi_mesh::Vector3, 4 > &radii_vectors_xy_tilde, std::array< double, 4 > &sub_sub_sqr_areas)
chi_mesh::Vector3 translation_vector
std::array< chi_mesh::Vector3, 4 > sub_sqr_points
chi_mesh::Matrix3x3 rotation_matrix
std::array< double, 4 > sub_sqr_weights