11std::array<chi_math::SimplifiedLDFESQ::SphericalQuadrilateral,4>
16 std::array<SphericalQuadrilateral,4> new_sqs;
26 std::array<std::array<chi_mesh::Vertex,4>,4> sub_sub_square_xy_tilde;
27 std::map<std::string,chi_mesh::Vertex> vm;
35 vm[
"c"] = sq_tilde_center;
37 auto& sst = sub_sub_square_xy_tilde;
38 sst[0] = {vm[
"0"],vm[
"01"],vm[
"c"],vm[
"03"]};
39 sst[1] = {vm[
"01"],vm[
"1"],vm[
"12"],vm[
"c"]};
40 sst[2] = {vm[
"c"],vm[
"12"],vm[
"2"],vm[
"23"]};
41 sst[3] = {vm[
"03"],vm[
"c"],vm[
"23"],vm[
"3"]};
43 for (
int i=0; i<4; ++i)
44 new_sqs[i].vertices_xy_tilde = sst[i];
47 for (
int i=0; i<4; ++i)
48 for (
int v=0; v<4; ++v)
53 for (
int i=0; i<4; ++i)
54 for (
int v=0; v<4; ++v)
55 new_sqs[i].vertices_xyz[v] = new_sqs[i].vertices_xyz_prime[v].Normalized();
59 for (
int i=0; i<4; ++i)
61 for (
int v=0; v<4; ++v)
62 new_sqs[i].centroid_xyz += new_sqs[i].vertices_xyz[v];
63 new_sqs[i].centroid_xyz /= 4;
73 for (
int v=0; v<4; ++v)
75 new_sqs[i].vertices_xyz[v] = new_sqs[i].vertices_xyz[v]*sq.
octant_modifier;
76 new_sqs[i].sub_sqr_points[v] = new_sqs[i].sub_sqr_points[v]*sq.
octant_modifier;
87 const double cone_size,
88 const bool dir_as_plane_normal)
91 double mu_cone = cos(cone_size);
92 std::vector<SphericalQuadrilateral> new_deployment;
93 new_deployment.reserve(deployed_SQs_.size());
98 for (
auto& sq : deployed_SQs_)
100 bool sq_to_be_split =
false;
102 if (not dir_as_plane_normal)
103 sq_to_be_split = sq.centroid_xyz.Dot(ref_dir_n)>mu_cone;
105 sq_to_be_split = std::fabs(sq.centroid_xyz.Dot(ref_dir_n)) <
108 if (not sq_to_be_split)
109 new_deployment.push_back(sq);
112 auto new_sqs = SplitSQ(sq,legendre);
113 for (
auto& nsq : new_sqs)
114 new_deployment.push_back(nsq);
119 deployed_SQs_.clear();
120 deployed_SQs_ = new_deployment;
121 deployed_SQs_history_.push_back(new_deployment);
123 PopulateQuadratureAbscissae();
125 Chi::log.
Log() <<
"SLDFESQ refined " << num_refined <<
" SQs.";
LogStream Log(LOG_LVL level=LOG_0)
void DevelopSQLDFEValues(SphericalQuadrilateral &sq, chi_math::QuadratureGaussLegendre &legendre)
void LocallyRefine(const chi_mesh::Vector3 &ref_dir, const double cone_size, const bool dir_as_plane_normal=false)
static double ComputeSphericalQuadrilateralArea(std::array< chi_mesh::Vertex, 4 > &vertices_xyz)
std::array< SphericalQuadrilateral, 4 > SplitSQ(SphericalQuadrilateral &sq, chi_math::QuadratureGaussLegendre &legendre)
std::array< chi_mesh::Vertex, 4 > vertices_xy_tilde
On square.
chi_mesh::Vector3 translation_vector
chi_mesh::Matrix3x3 rotation_matrix
chi_mesh::Vector3 octant_modifier
Vector3 Normalized() const