59 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
61 const std::vector<Real>& JxW = fe->get_JxW();
62 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
64 n_phi = fe->n_shape_functions(),
68 material_mat = RealMatrixX::Zero(dim, dim),
69 dmaterial_mat = RealMatrixX::Zero(dim, dim),
70 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
72 vec1 = RealVectorX::Zero(1),
73 vec2_n2 = RealVectorX::Zero(n_phi),
74 flux = RealVectorX::Zero(dim);
76 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
79 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
83 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
93 (*conductance)(xyz[qp],
_time, material_mat);
100 for (
unsigned int j=0; j<dim; j++) {
101 dBmat[j].right_multiply(vec1,
_sol);
103 for (
unsigned int i=0; i<dim; i++)
104 flux(i) += vec1(0) * material_mat(i,j);
108 for (
unsigned int i=0; i<dim; i++) {
110 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
111 f += JxW[qp] * vec2_n2;
115 if (request_jacobian) {
118 for (
unsigned int i=0; i<dim; i++)
119 for (
unsigned int j=0; j<dim; j++) {
121 dBmat[i].right_multiply_transpose(mat_n2n2, dBmat[j]);
122 jac += JxW[qp] * material_mat(i,j) * mat_n2n2;
130 _time, dmaterial_mat);
132 for (
unsigned int j=0; j<dim; j++) {
133 dBmat[j].right_multiply(vec1,
_sol);
135 for (
unsigned int i=0; i<dim; i++)
136 if (dmaterial_mat(i,j) != 0.) {
138 dBmat[i].right_multiply_transpose(mat_n2n2, Bmat);
140 jac += JxW[qp] * vec1(0) * dmaterial_mat(i,j) * mat_n2n2;
163 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
165 const std::vector<Real>& JxW = fe->get_JxW();
166 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
169 n_phi = fe->n_shape_functions(),
173 material_mat = RealMatrixX::Zero(dim, dim),
174 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
176 vec1 = RealVectorX::Zero(1),
177 vec2_n2 = RealVectorX::Zero(n_phi);
179 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > capacitance =
182 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
191 (*capacitance)(xyz[qp],
_time, material_mat);
196 f += JxW[qp] * material_mat(0,0) * vec2_n2;
198 if (request_jacobian) {
201 jac_xdot += JxW[qp] * material_mat(0,0) * mat_n2n2;
208 _time, material_mat);
210 if (material_mat(0,0) != 0.) {
213 jac += JxW[qp] * vec1(0) * material_mat(0,0) * mat_n2n2;
233 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
235 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
238 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
242 for ( ; it != end; it++) {
244 std::vector<MAST::BoundaryConditionBase*>::const_iterator
245 bc_it = it->second.begin(),
246 bc_end = it->second.end();
248 for ( ; bc_it != bc_end; bc_it++) {
251 switch ((*bc_it)->type()) {
295 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
297 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
300 std::pair<maptype::const_iterator, maptype::const_iterator> it;
307 it =bc.equal_range(sid);
309 for ( ; it.first != it.second; it.first++) {
311 switch (it.first->second->type()) {
351 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
353 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
356 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
360 for ( ; it != end; it++) {
362 std::vector<MAST::BoundaryConditionBase*>::const_iterator
363 bc_it = it->second.begin(),
364 bc_end = it->second.end();
366 for ( ; bc_it != bc_end; bc_it++) {
369 switch ((*bc_it)->type()) {
411 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
413 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
416 std::pair<maptype::const_iterator, maptype::const_iterator> it;
423 it =bc.equal_range(sid);
425 for ( ; it.first != it.second; it.first++) {
427 switch (it.first->second->type()) {
468 const unsigned int s,
470 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
472 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
475 std::pair<maptype::const_iterator, maptype::const_iterator> it;
482 it =bc.equal_range(sid);
484 for ( ; it.first != it.second; it.first++) {
486 switch (it.first->second->type()) {
537 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
539 const std::vector<Real>& JxW = fe->get_JxW();
540 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
542 n_phi = fe->n_shape_functions(),
546 material_mat = RealMatrixX::Zero(dim, dim),
547 dmaterial_mat = RealMatrixX::Zero(dim, dim),
548 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
550 vec1 = RealVectorX::Zero(1),
551 vec2_n2 = RealVectorX::Zero(n_phi),
552 flux = RealVectorX::Zero(dim);
554 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
557 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
561 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
578 for (
unsigned int j=0; j<dim; j++) {
579 dBmat[j].right_multiply(vec1,
_sol);
581 for (
unsigned int i=0; i<dim; i++)
582 flux(i) += vec1(0) * material_mat(i,j);
586 for (
unsigned int i=0; i<dim; i++) {
588 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
589 f += JxW[qp] * vec2_n2;
604 const unsigned int s,
610 std::vector<Real> JxW_Vn = fe->get_JxW();
611 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
612 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
615 n_phi = fe->n_shape_functions(),
619 material_mat = RealMatrixX::Zero(dim, dim),
620 dmaterial_mat = RealMatrixX::Zero(dim, dim),
621 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
623 vec1 = RealVectorX::Zero(1),
624 vec2_n2 = RealVectorX::Zero(n_phi),
625 flux = RealVectorX::Zero(dim),
626 vel = RealVectorX::Zero(dim);
628 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
631 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
638 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
640 vel_f(xyz[qp],
_time, vel);
642 for (
unsigned int i=0; i<dim; i++)
643 vn += vel(i)*face_normals[qp](i);
648 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
658 (*conductance)(xyz[qp],
_time, material_mat);
665 for (
unsigned int j=0; j<dim; j++) {
666 dBmat[j].right_multiply(vec1,
_sol);
668 for (
unsigned int i=0; i<dim; i++)
669 flux(i) += vec1(0) * material_mat(i,j);
673 for (
unsigned int i=0; i<dim; i++) {
675 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
676 f += JxW_Vn[qp] * vec2_n2;
694 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
696 const std::vector<Real>& JxW = fe->get_JxW();
697 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
700 n_phi = fe->n_shape_functions(),
704 material_mat = RealMatrixX::Zero(dim, dim),
705 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
707 vec1 = RealVectorX::Zero(1),
708 vec2_n2 = RealVectorX::Zero(n_phi);
710 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > capacitance =
713 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
727 f += JxW[qp] * material_mat(0,0) * vec2_n2;
743 const unsigned int s,
749 std::vector<Real> JxW_Vn = fe->get_JxW();
750 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
751 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
756 n_phi = fe->n_shape_functions(),
760 material_mat = RealMatrixX::Zero(dim, dim),
761 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
763 vec1 = RealVectorX::Zero(1),
764 vec2_n2 = RealVectorX::Zero(n_phi),
765 vel = RealVectorX::Zero(dim);
767 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > capacitance =
774 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
776 vel_f(xyz[qp],
_time, vel);
778 for (
unsigned int i=0; i<dim; i++)
779 vn += vel(i)*face_normals[qp](i);
783 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
792 (*capacitance)(xyz[qp],
_time, material_mat);
797 f += JxW_Vn[qp] * material_mat(0,0) * vec2_n2;
815 const unsigned int s,
827 const std::vector<Real> &JxW = fe->get_JxW();
828 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
829 const std::vector<std::vector<Real> >& phi = fe->get_phi();
830 const unsigned int n_phi = (
unsigned int)phi.size();
835 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
838 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
839 phi_vec(i_nd) = phi[i_nd][qp];
842 func(qpoint[qp],
_time, flux);
843 section(qpoint[qp],
_time, th);
845 f += JxW[qp] * phi_vec * flux * th;
864 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
866 const std::vector<Real> &JxW = fe->get_JxW();
867 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
868 const std::vector<std::vector<Real> >& phi = fe->get_phi();
869 const unsigned int n_phi = (
unsigned int)phi.size();
874 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
877 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
878 phi_vec(i_nd) = phi[i_nd][qp];
881 func(qpoint[qp],
_time, flux);
883 f += JxW[qp] * phi_vec * flux;
894 const unsigned int s,
907 const std::vector<Real> &JxW = fe->get_JxW();
908 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
909 const std::vector<std::vector<Real> >& phi = fe->get_phi();
910 const unsigned int n_phi = (
unsigned int)phi.size();
913 Real flux, dflux, th, dth;
915 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
918 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
919 phi_vec(i_nd) = phi[i_nd][qp];
922 func(qpoint[qp],
_time, flux);
923 func.derivative(p, qpoint[qp],
_time, dflux);
924 section(qpoint[qp],
_time, th);
925 section.derivative(p, qpoint[qp],
_time, dth);
927 f += JxW[qp] * phi_vec * (flux*dth + dflux*th);
944 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
946 const std::vector<Real> &JxW = fe->get_JxW();
947 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
948 const std::vector<std::vector<Real> >& phi = fe->get_phi();
949 const unsigned int n_phi = (
unsigned int)phi.size();
954 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
957 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
958 phi_vec(i_nd) = phi[i_nd][qp];
963 f += JxW[qp] * phi_vec * flux;
973 const unsigned int s,
981 std::vector<Real> JxW_Vn = fe->get_JxW();
982 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
983 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
984 const std::vector<std::vector<Real> >& phi = fe->get_phi();
986 n_phi = (
unsigned int)phi.size(),
990 phi_vec = RealVectorX::Zero(n_phi),
991 vel = RealVectorX::Zero(dim);
998 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1000 vel_f(xyz[qp],
_time, vel);
1002 for (
unsigned int i=0; i<dim; i++)
1003 vn += vel(i)*face_normals[qp](i);
1012 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1015 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1016 phi_vec(i_nd) = phi[i_nd][qp];
1019 func(xyz[qp],
_time, flux);
1021 f += JxW_Vn[qp] * phi_vec * flux;
1031 const unsigned int s,
1043 const std::vector<Real> &JxW = fe->get_JxW();
1044 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1045 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1046 const unsigned int n_phi = (
unsigned int)phi.size();
1050 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1051 Real temp, amb_temp, h_coeff, th;
1055 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1058 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1059 phi_vec(i_nd) = phi[i_nd][qp];
1062 coeff(qpoint[qp],
_time, h_coeff);
1063 T_amb(qpoint[qp],
_time, amb_temp);
1064 section(qpoint[qp],
_time, th);
1065 temp = phi_vec.dot(
_sol);
1070 f += JxW[qp] * phi_vec * th* h_coeff * (temp - amb_temp);
1072 if (request_jacobian) {
1076 jac += JxW[qp] * mat * th * h_coeff;
1098 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1100 const std::vector<Real> &JxW = fe->get_JxW();
1101 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1102 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1103 const unsigned int n_phi = (
unsigned int)phi.size();
1107 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1108 Real temp, amb_temp, h_coeff;
1112 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1115 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1116 phi_vec(i_nd) = phi[i_nd][qp];
1119 coeff(qpoint[qp],
_time, h_coeff);
1120 T_amb(qpoint[qp],
_time, amb_temp);
1121 temp = phi_vec.dot(
_sol);
1126 f += JxW[qp] * phi_vec * h_coeff * (temp - amb_temp);
1128 if (request_jacobian) {
1132 jac += JxW[qp] * mat * h_coeff;
1146 const unsigned int s,
1158 const std::vector<Real> &JxW = fe->get_JxW();
1159 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1160 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1161 const unsigned int n_phi = (
unsigned int)phi.size();
1165 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1167 temp, amb_temp, h_coeff, th,
1168 damb_temp, dh_coeff, dth;
1172 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1175 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1176 phi_vec(i_nd) = phi[i_nd][qp];
1179 coeff(qpoint[qp],
_time, h_coeff);
1180 T_amb(qpoint[qp],
_time, amb_temp);
1181 section(qpoint[qp],
_time, th);
1182 coeff.derivative(p, qpoint[qp],
_time, dh_coeff);
1183 T_amb.derivative(p, qpoint[qp],
_time, damb_temp);
1184 section.derivative(p, qpoint[qp],
_time, dth);
1185 temp = phi_vec.dot(
_sol);
1190 f += JxW[qp] * phi_vec * (th * dh_coeff * (temp - amb_temp) +
1191 th * h_coeff * (-damb_temp) +
1192 dth* h_coeff * (temp - amb_temp));
1210 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1212 const std::vector<Real> &JxW = fe->get_JxW();
1213 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1214 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1215 const unsigned int n_phi = (
unsigned int)phi.size();
1219 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1221 temp, amb_temp, h_coeff,
1222 damb_temp, dh_coeff;
1226 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1229 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1230 phi_vec(i_nd) = phi[i_nd][qp];
1233 coeff(qpoint[qp],
_time, h_coeff);
1234 T_amb(qpoint[qp],
_time, amb_temp);
1236 T_amb.derivative(p, qpoint[qp],
_time, damb_temp);
1237 temp = phi_vec.dot(
_sol);
1242 f += JxW[qp] * phi_vec * (dh_coeff * (temp - amb_temp)+
1243 h_coeff * (-damb_temp));
1254 const unsigned int s,
1261 std::vector<Real> JxW_Vn = fe->get_JxW();
1262 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1263 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1264 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1272 n_phi = (
unsigned int)phi.size(),
1277 phi_vec = RealVectorX::Zero(n_phi),
1278 vel = RealVectorX::Zero(dim);
1280 mat = RealMatrixX::Zero(n_phi, n_phi);
1282 Real temp, amb_temp, h_coeff;
1290 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1292 vel_f(xyz[qp],
_time, vel);
1294 for (
unsigned int i=0; i<dim; i++)
1295 vn += vel(i)*face_normals[qp](i);
1299 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1302 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1303 phi_vec(i_nd) = phi[i_nd][qp];
1306 coeff(xyz[qp],
_time, h_coeff);
1307 T_amb(xyz[qp],
_time, amb_temp);
1308 temp = phi_vec.dot(
_sol);
1313 f += JxW_Vn[qp] * phi_vec * h_coeff * (temp - amb_temp);
1326 const unsigned int s,
1343 const std::vector<Real> &JxW = fe->get_JxW();
1344 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1345 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1346 const unsigned int n_phi = (
unsigned int)phi.size();
1349 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1353 zero_ref = T_ref_zero();
1354 Real temp, emiss, th;
1357 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1360 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1361 phi_vec(i_nd) = phi[i_nd][qp];
1364 emissivity(qpoint[qp],
_time, emiss);
1365 section(qpoint[qp],
_time, th);
1366 temp = phi_vec.dot(
_sol);
1368 f += JxW[qp] * phi_vec * sbc * emiss * th *
1369 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1371 if (request_jacobian) {
1375 jac += JxW[qp] * mat * sbc * emiss * th * 4. * pow(temp+zero_ref, 3.);
1399 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1401 const std::vector<Real> &JxW = fe->get_JxW();
1402 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1403 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1404 const unsigned int n_phi = (
unsigned int)phi.size();
1407 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1411 zero_ref = T_ref_zero();
1415 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1418 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1419 phi_vec(i_nd) = phi[i_nd][qp];
1422 emissivity(qpoint[qp],
_time, emiss);
1423 temp = phi_vec.dot(
_sol);
1425 f += JxW[qp] * phi_vec * sbc * emiss *
1426 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1428 if (request_jacobian) {
1432 jac += JxW[qp] * mat * sbc * emiss * 4. * pow(temp+zero_ref, 3.);
1445 const unsigned int s,
1463 const std::vector<Real> &JxW = fe->get_JxW();
1464 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1465 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1466 const unsigned int n_phi = (
unsigned int)phi.size();
1469 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1473 zero_ref = T_ref_zero();
1474 Real temp, emiss, demiss, th, dth;
1477 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1480 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1481 phi_vec(i_nd) = phi[i_nd][qp];
1484 emissivity(qpoint[qp],
_time, emiss);
1485 emissivity.derivative(p, qpoint[qp],
_time, demiss);
1486 section(qpoint[qp],
_time, th);
1487 section.derivative(p, qpoint[qp],
_time, dth);
1488 temp = phi_vec.dot(
_sol);
1490 f += JxW[qp] * phi_vec * sbc * (demiss * th + emiss * dth) *
1491 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1513 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1515 const std::vector<Real> &JxW = fe->get_JxW();
1516 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1517 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1518 const unsigned int n_phi = (
unsigned int)phi.size();
1521 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1525 zero_ref = T_ref_zero();
1529 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1532 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1533 phi_vec(i_nd) = phi[i_nd][qp];
1537 temp = phi_vec.dot(
_sol);
1539 f += JxW[qp] * phi_vec * sbc * demiss *
1540 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1549 const unsigned int s,
1556 std::vector<Real> JxW_Vn = fe->get_JxW();
1557 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1558 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1559 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1571 n_phi = (
unsigned int)phi.size(),
1575 phi_vec = RealVectorX::Zero(n_phi),
1576 vel = RealVectorX::Zero(dim);
1578 mat = RealMatrixX::Zero(n_phi, n_phi);
1583 zero_ref = T_ref_zero();
1594 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1596 vel_f(xyz[qp],
_time, vel);
1598 for (
unsigned int i=0; i<dim; i++)
1599 vn += vel(i)*face_normals[qp](i);
1603 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1606 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1607 phi_vec(i_nd) = phi[i_nd][qp];
1610 emissivity(xyz[qp],
_time, emiss);
1611 temp = phi_vec.dot(
_sol);
1613 f += JxW_Vn[qp] * phi_vec * sbc * emiss *
1614 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1633 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1635 const std::vector<Real> &JxW = fe->get_JxW();
1636 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1637 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1638 const unsigned int n_phi = (
unsigned int)phi.size();
1643 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1646 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1647 phi_vec(i_nd) = phi[i_nd][qp];
1650 func(qpoint[qp],
_time, source);
1651 section(qpoint[qp],
_time, th);
1653 f -= JxW[qp] * phi_vec * source * th;
1670 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1672 const std::vector<Real> &JxW = fe->get_JxW();
1673 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1674 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1675 const unsigned int n_phi = (
unsigned int)phi.size();
1678 Real source, dsource, th, dth;
1680 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1683 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1684 phi_vec(i_nd) = phi[i_nd][qp];
1687 func(qpoint[qp],
_time, source);
1689 section(qpoint[qp],
_time, th);
1690 section.derivative(p, qpoint[qp],
_time, dth);
1692 f -= JxW[qp] * phi_vec * (dsource * th + source * dth);
1701 const unsigned int s,
1708 std::vector<Real> JxW_Vn = fe->get_JxW();
1709 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1710 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1711 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1719 n_phi = (
unsigned int)phi.size(),
1723 phi_vec = RealVectorX::Zero(n_phi),
1724 vel = RealVectorX::Zero(dim);
1731 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1733 vel_f(xyz[qp],
_time, vel);
1735 for (
unsigned int i=0; i<dim; i++)
1736 vn += vel(i)*face_normals[qp](i);
1740 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1743 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1744 phi_vec(i_nd) = phi[i_nd][qp];
1747 func(xyz[qp],
_time, source);
1748 section(xyz[qp],
_time, th);
1750 f -= JxW_Vn[qp] * phi_vec * source * th;
1763 const std::vector<std::vector<Real> >& phi_fe = fe.
get_phi();
1765 const unsigned int n_phi = (
unsigned int)phi_fe.size();
1771 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1772 phi(i_nd) = phi_fe[i_nd][qp];
1783 const unsigned int dim,
1785 std::vector<MAST::FEMOperatorMatrix>& dBmat) {
1787 libmesh_assert(dBmat.size() == dim);
1789 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
1791 const unsigned int n_phi = (
unsigned int)dphi.size();
1795 for (
unsigned int i_dim=0; i_dim<dim; i_dim++) {
1797 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1798 phi(i_nd) = dphi[i_nd][qp](i_dim);
1799 dBmat[i_dim].reinit(1, phi);
virtual void surface_convection_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector sensitivity and Jacobian due to surface convection.
void _initialize_mass_fem_operator(const unsigned int qp, const MAST::FEBase &fe, MAST::FEMOperatorMatrix &Bmat)
When mass = false, initializes the FEM operator matrix to the shape functions as .
void side_external_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase * > &bc)
side external force contribution to system residual
virtual const MAST::FieldFunction< Real > & section(const MAST::ElementBase &e) const =0
MAST::FunctionBase * _active_sol_function
pointer to the active solution mesh field function.
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealVectorX &v) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
HeatConductionElementBase(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
Constructor.
virtual void volume_heat_source_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to volume heat source.
const MAST::GeomElem & _elem
geometric element for which the computations are performed
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_capacitance_matrix(const MAST::ElementBase &e) const =0
virtual void internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
internal force contribution to system residual
virtual void surface_flux_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector sensitivity and Jacobian due to surface flux on element side s...
void reinit(unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
this initializes the operator for number of rows and variables, assuming that all variables has the s...
This provides a wrapper FieldFunction compatible class that interpolates the solution using libMesh's...
virtual void surface_flux_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface flux on element side s.
void side_external_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase * > &bc)
sensitivity of the side external force contribution to system residual
virtual void volume_heat_source_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to volume heat source on element volumetric domain...
RealVectorX _vel
local velocity
This is a scalar function whose value can be changed and one that can be used as a design variable in...
void right_multiply(T &r, const T &m) const
[R] = [this] * [M]
void volume_external_residual_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > &bc)
boundary velocity contribution of volume external force.
virtual void internal_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f)
sensitivity of the internal force contribution to system residual
virtual const libMesh::Elem & get_reference_elem() const
void _initialize_fem_gradient_operator(const unsigned int qp, const unsigned int dim, const MAST::FEBase &fe, std::vector< MAST::FEMOperatorMatrix > &dBmat)
For mass = true, the FEM operator matrix is initilized to the weak form of the Laplacian ...
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
virtual void surface_radiation_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface flux on element volumetric domain...
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual void surface_convection_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface convection.
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_conductance_matrix(const MAST::ElementBase &e) const =0
Matrix< Real, Dynamic, 1 > RealVectorX
virtual void surface_convection_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface flux on element volumetric domain...
virtual void volume_heat_source_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to volume heat source.
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
RealVectorX _sol
local solution
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
virtual ~HeatConductionElementBase()
virtual void external_side_loads_for_quadrature_elem(std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase * > &bc, std::map< unsigned int, std::vector< MAST::BoundaryConditionBase * >> &loads) const
From the given list of boundary loads, this identifies the sides of the quadrature element and the lo...
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
void volume_external_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > &bc)
volume external force contribution to system residual
virtual void surface_flux_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface flux on element volumetric domain...
virtual const std::vector< std::vector< Real > > & get_phi() const
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
virtual void velocity_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac)
inertial force contribution to system residual
virtual void surface_radiation_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector sensitivity and Jacobian due to surface radiation flux on element side...
virtual void velocity_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f)
sensitivity of the damping force contribution to system residual
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
const Real & _time
time for which system is being assembled
virtual void internal_residual_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f)
sensitivity of the internal force contribution to system residual
virtual void surface_radiation_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to surface radiation flux on side s...
const MAST::ElementPropertyCardBase & _property
element property
void volume_external_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > &bc)
sensitivity of the volume external force contribution to system residual
virtual void velocity_residual_boundary_velocity(const MAST::FunctionBase &p, RealVectorX &f, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f)
sensitivity of the internal force contribution to system residual
This is the base class for elements that implement calculation of finite element quantities over the ...