39 using namespace QuadTreeNames;
93 for (
int i = 0;
i < 2;
i++)
98 corner_SW[
i] + (corner_SE[
i] - corner_SW[
i]) * 0.5 * (
s[0] + 1.0);
100 corner_NW[
i] + (corner_NE[
i] - corner_NW[
i]) * 0.5 * (
s[0] + 1.0);
103 f_rect[
i] = edge_S[
i] + (edge_N[
i] - edge_S[
i]) * 0.5 * (
s[1] + 1.0);
106 diff_N[
i] = bound_N[
i] - f_rect[
i];
107 diff_S[
i] = bound_S[
i] - f_rect[
i];
108 diff_E[
i] = bound_E[
i] - f_rect[
i];
109 diff_W[
i] = bound_W[
i] - f_rect[
i];
112 r[
i] = f_rect[
i] + diff_S[
i] * (1.0 - 0.5 * (
s[1] + 1.0)) +
113 diff_N[
i] * 0.5 * (
s[1] + 1.0) +
114 diff_W[
i] * (1.0 - 0.5 * (
s[0] + 1.0)) +
115 diff_E[
i] * 0.5 * (
s[0] + 1.0);
127 using namespace QuadTreeNames;
181 for (
int i = 0;
i < 2;
i++)
186 corner_SW[
i] + (corner_SE[
i] - corner_SW[
i]) * 0.5 * (
S[0] + 1.0);
188 corner_NW[
i] + (corner_NE[
i] - corner_NW[
i]) * 0.5 * (
S[0] + 1.0);
191 f_rect[
i] = edge_S[
i] + (edge_N[
i] - edge_S[
i]) * 0.5 * (
S[1] + 1.0);
194 diff_N[
i] = bound_N[
i] - f_rect[
i];
195 diff_S[
i] = bound_S[
i] - f_rect[
i];
196 diff_E[
i] = bound_E[
i] - f_rect[
i];
197 diff_W[
i] = bound_W[
i] - f_rect[
i];
200 r[
i] = f_rect[
i] + diff_S[
i] * (1.0 - 0.5 * (
S[1] + 1.0)) +
201 diff_N[
i] * 0.5 * (
S[1] + 1.0) +
202 diff_W[
i] * (1.0 - 0.5 * (
S[0] + 1.0)) +
203 diff_E[
i] * 0.5 * (
S[0] + 1.0);
212 const unsigned& nplot)
214 using namespace QuadTreeNames;
220 for (
unsigned idirect =
N; idirect <=
W; idirect++)
222 outfile <<
"ZONE I=" << nplot << std::endl;
223 for (
unsigned j = 0; j < nplot; j++)
225 s[0] = -1.0 + 2.0 * double(j) / double(nplot - 1);
228 outfile << f[0] <<
" " << f[1] << std::endl;
241 using namespace QuadTreeNames;
301 0.25 * (corner_SW[0] - corner_SE[0] + corner_NW[0] - corner_NE[0] -
302 corner_NE[0] *
S[1] + corner_NW[0] *
S[1] + corner_SE[0] *
S[1] -
303 corner_SW[0] *
S[1]) +
304 0.5 * (dbound_S[0] + dbound_N[0] - bound_W[0] + bound_E[0] -
305 dbound_S[0] *
S[1] + dbound_N[0] *
S[1]);
308 0.25 * (corner_SW[1] - corner_SE[1] + corner_NW[1] - corner_NE[1] -
309 corner_NE[1] *
S[1] + corner_NW[1] *
S[1] + corner_SE[1] *
S[1] -
310 corner_SW[1] *
S[1]) +
311 0.5 * (dbound_S[1] + dbound_N[1] - bound_W[1] + bound_E[1] -
312 dbound_S[1] *
S[1] + dbound_N[1] *
S[1]);
315 0.25 * (corner_SW[0] + corner_SE[0] - corner_NW[0] - corner_NE[0] +
316 corner_SE[0] *
S[0] - corner_SW[0] *
S[0] - corner_NE[0] *
S[0] +
317 corner_NW[0] *
S[0]) +
318 0.5 * (-bound_S[0] + bound_N[0] + dbound_W[0] + dbound_E[0] -
319 dbound_W[0] *
S[0] + dbound_E[0] *
S[0]);
322 0.25 * (corner_SW[1] + corner_SE[1] - corner_NW[1] - corner_NE[1] +
323 corner_SE[1] *
S[0] - corner_SW[1] *
S[0] - corner_NE[1] *
S[0] +
324 corner_NW[1] *
S[0]) +
325 0.5 * (-bound_S[1] + bound_N[1] + dbound_W[1] + dbound_E[1] -
326 dbound_W[1] *
S[0] + dbound_E[1] *
S[0]);
337 using namespace QuadTreeNames;
409 jacobian2(0, 0) = 0.5 * (d2bound_S[0] + d2bound_N[0] - d2bound_S[0] *
S[1] +
410 d2bound_N[0] *
S[1]);
412 jacobian2(1, 0) = 0.5 * (d2bound_W[0] + d2bound_E[0] - d2bound_W[0] *
S[0] +
413 d2bound_E[0] *
S[0]);
416 0.25 * (-corner_NE[0] + corner_NW[0] + corner_SE[0] - corner_SW[0]) +
417 0.5 * (-dbound_W[0] + dbound_E[0] - dbound_S[0] + dbound_N[0]);
419 jacobian2(0, 1) = 0.5 * (d2bound_S[1] + d2bound_N[1] - d2bound_S[1] *
S[1] +
420 d2bound_N[1] *
S[1]);
422 jacobian2(1, 1) = 0.5 * (d2bound_W[1] + d2bound_E[1] - d2bound_W[1] *
S[0] +
423 d2bound_E[1] *
S[0]);
426 0.25 * (-corner_NE[1] + corner_NW[1] + corner_SE[1] - corner_SW[1]) +
427 0.5 * (-dbound_W[1] + dbound_E[1] - dbound_S[1] + dbound_N[1]);
568 for (
unsigned i = 0;
i < 3;
i++)
576 ptUp = corner_LU[
i] + (corner_RU[
i] - corner_LU[
i]) * 0.5 * (
S[0] + 1.0);
577 ptDo = corner_LD[
i] + (corner_RD[
i] - corner_LD[
i]) * 0.5 * (
S[0] + 1.0);
579 slice_mid = ptDo + 0.5 * (1.0 +
S[1]) * (ptUp - ptDo);
582 double diff_L, diff_R, diff_D, diff_U;
583 diff_L = edge_mid_L[
i] - slice_mid;
584 diff_R = edge_mid_R[
i] - slice_mid;
585 diff_D = edge_mid_D[
i] - slice_mid;
586 diff_U = edge_mid_U[
i] - slice_mid;
590 diff_L * (1.0 - 0.5 * (
S[0] + 1.0)) + diff_R * 0.5 * (
S[0] + 1.0) +
591 diff_D * (1.0 - 0.5 * (
S[1] + 1.0)) + diff_U * 0.5 * (
S[1] + 1.0);
600 corner_LUB[
i] + (corner_RUB[
i] - corner_LUB[
i]) * 0.5 * (
S[0] + 1.0);
602 corner_LDB[
i] + (corner_RDB[
i] - corner_LDB[
i]) * 0.5 * (
S[0] + 1.0);
604 slice_back = ptDo + 0.5 * (1.0 +
S[1]) * (ptUp - ptDo);
607 diff_L = edge_back_L[
i] - slice_back;
608 diff_R = edge_back_R[
i] - slice_back;
609 diff_D = edge_back_D[
i] - slice_back;
610 diff_U = edge_back_U[
i] - slice_back;
614 diff_L * (1.0 - 0.5 * (
S[0] + 1.0)) + diff_R * 0.5 * (
S[0] + 1.0) +
615 diff_D * (1.0 - 0.5 * (
S[1] + 1.0)) + diff_U * 0.5 * (
S[1] + 1.0);
623 corner_LUF[
i] + (corner_RUF[
i] - corner_LUF[
i]) * 0.5 * (
S[0] + 1.0);
625 corner_LDF[
i] + (corner_RDF[
i] - corner_LDF[
i]) * 0.5 * (
S[0] + 1.0);
627 slice_front = ptDo + 0.5 * (1.0 +
S[1]) * (ptUp - ptDo);
630 diff_L = edge_front_L[
i] - slice_front;
631 diff_R = edge_front_R[
i] - slice_front;
632 diff_D = edge_front_D[
i] - slice_front;
633 diff_U = edge_front_U[
i] - slice_front;
637 diff_L * (1.0 - 0.5 * (
S[0] + 1.0)) + diff_R * 0.5 * (
S[0] + 1.0) +
638 diff_D * (1.0 - 0.5 * (
S[1] + 1.0)) + diff_U * 0.5 * (
S[1] + 1.0);
644 double diff_back = face_B[
i] - slice_back;
645 double diff_front = face_F[
i] - slice_front;
650 r[
i] = slice_mid + 0.5 * (1 +
S[2]) * diff_front +
651 0.5 * (1 -
S[2]) * diff_back;
660 const unsigned& nplot)
662 using namespace OcTreeNames;
668 for (
unsigned idirect =
L; idirect <=
F; idirect++)
670 outfile <<
"ZONE I=" << nplot <<
", J=" << nplot << std::endl;
671 for (
unsigned i = 0;
i < nplot;
i++)
673 s[1] = -1.0 + 2.0 * double(
i) / double(nplot - 1);
674 for (
unsigned j = 0; j < nplot; j++)
676 s[0] = -1.0 + 2.0 * double(j) / double(nplot - 1);
679 outfile << f[0] <<
" " << f[1] <<
" " << f[2] << std::endl;
virtual void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)=0
Vector representation of the i_macro-th macro element boundary i_direct (e.g. N/S/W/E in 2D) at time ...
virtual void dmacro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
Vector representation of the i_macro-th macro element boundary derivatives i_direct (e....
virtual void d2macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
Vector representation of the i_macro-th macro element boundary second derivatives i_direct (e....
Domain * Domain_pt
Pointer to domain.
virtual void assemble_macro_to_eulerian_jacobian2(const unsigned &t, const Vector< double > &s, DenseMatrix< double > &jacobian2)
Assembles the second derivative jacobian of the mapping from the macro coordinates to the global coor...
virtual void output_macro_element_boundaries(std::ostream &outfile, const unsigned &nplot)=0
Output all macro element boundaries as tecplot zones.
void macro_map(const Vector< double > &s, Vector< double > &r)
The mapping from local to global coordinates at the current time : r(s)
unsigned Macro_element_number
What is the number of the current macro element within its domain.
virtual void assemble_macro_to_eulerian_jacobian(const unsigned &t, const Vector< double > &s, DenseMatrix< double > &jacobian)
the jacobian of the mapping from the macro coordinates to the global coordinates
//////////////////////////////////////////////////////////////////// ////////////////////////////////...