58 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
60 const std::vector<Real>& JxW = fe->get_JxW();
61 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
63 n_phi = fe->n_shape_functions(),
67 material_mat = RealMatrixX::Zero(dim, dim),
68 dmaterial_mat = RealMatrixX::Zero(dim, dim),
69 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
71 vec1 = RealVectorX::Zero(1),
72 vec2_n2 = RealVectorX::Zero(n_phi),
73 flux = RealVectorX::Zero(dim);
75 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
78 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
82 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
92 (*conductance)(xyz[qp],
_time, material_mat);
99 for (
unsigned int j=0; j<dim; j++) {
100 dBmat[j].right_multiply(vec1,
_sol);
102 for (
unsigned int i=0; i<dim; i++)
103 flux(i) += vec1(0) * material_mat(i,j);
107 for (
unsigned int i=0; i<dim; i++) {
109 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
110 f += JxW[qp] * vec2_n2;
114 if (request_jacobian) {
117 for (
unsigned int i=0; i<dim; i++)
118 for (
unsigned int j=0; j<dim; j++) {
120 dBmat[i].right_multiply_transpose(mat_n2n2, dBmat[j]);
121 jac += JxW[qp] * material_mat(i,j) * mat_n2n2;
129 _time, dmaterial_mat);
131 for (
unsigned int j=0; j<dim; j++) {
132 dBmat[j].right_multiply(vec1,
_sol);
134 for (
unsigned int i=0; i<dim; i++)
135 if (dmaterial_mat(i,j) != 0.) {
137 dBmat[i].right_multiply_transpose(mat_n2n2, Bmat);
139 jac += JxW[qp] * vec1(0) * dmaterial_mat(i,j) * mat_n2n2;
162 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
164 const std::vector<Real>& JxW = fe->get_JxW();
165 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
168 n_phi = fe->n_shape_functions(),
172 material_mat = RealMatrixX::Zero(dim, dim),
173 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
175 vec1 = RealVectorX::Zero(1),
176 vec2_n2 = RealVectorX::Zero(n_phi),
177 local_f = 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 local_f += JxW[qp] * material_mat(0,0) * vec2_n2;
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;
222 for (
unsigned int i=0; i<jac_xdot.rows(); i++) {
224 Real a = jac_xdot.row(i).sum();
225 jac_xdot.row(i).setZero();
229 f += jac_xdot *
_vel;
232 if (!request_jacobian) {
253 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
255 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
258 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
262 for ( ; it != end; it++) {
264 std::vector<MAST::BoundaryConditionBase*>::const_iterator
265 bc_it = it->second.begin(),
266 bc_end = it->second.end();
268 for ( ; bc_it != bc_end; bc_it++) {
271 switch ((*bc_it)->type()) {
315 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
317 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
320 std::pair<maptype::const_iterator, maptype::const_iterator> it;
327 it =bc.equal_range(sid);
329 for ( ; it.first != it.second; it.first++) {
331 switch (it.first->second->type()) {
371 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
373 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
376 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
380 for ( ; it != end; it++) {
382 std::vector<MAST::BoundaryConditionBase*>::const_iterator
383 bc_it = it->second.begin(),
384 bc_end = it->second.end();
386 for ( ; bc_it != bc_end; bc_it++) {
389 switch ((*bc_it)->type()) {
431 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
433 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
436 std::pair<maptype::const_iterator, maptype::const_iterator> it;
443 it =bc.equal_range(sid);
445 for ( ; it.first != it.second; it.first++) {
447 switch (it.first->second->type()) {
488 const unsigned int s,
490 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>& bc) {
492 typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> maptype;
495 std::pair<maptype::const_iterator, maptype::const_iterator> it;
502 it =bc.equal_range(sid);
504 for ( ; it.first != it.second; it.first++) {
506 switch (it.first->second->type()) {
557 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
559 const std::vector<Real>& JxW = fe->get_JxW();
560 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
562 n_phi = fe->n_shape_functions(),
566 material_mat = RealMatrixX::Zero(dim, dim),
567 dmaterial_mat = RealMatrixX::Zero(dim, dim),
568 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
570 vec1 = RealVectorX::Zero(1),
571 vec2_n2 = RealVectorX::Zero(n_phi),
572 flux = RealVectorX::Zero(dim);
574 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
577 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
581 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
598 for (
unsigned int j=0; j<dim; j++) {
599 dBmat[j].right_multiply(vec1,
_sol);
601 for (
unsigned int i=0; i<dim; i++)
602 flux(i) += vec1(0) * material_mat(i,j);
606 for (
unsigned int i=0; i<dim; i++) {
608 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
609 f += JxW[qp] * vec2_n2;
624 const unsigned int s,
630 std::vector<Real> JxW_Vn = fe->get_JxW();
631 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
632 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
635 n_phi = fe->n_shape_functions(),
639 material_mat = RealMatrixX::Zero(dim, dim),
640 dmaterial_mat = RealMatrixX::Zero(dim, dim),
641 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi);
643 vec1 = RealVectorX::Zero(1),
644 vec2_n2 = RealVectorX::Zero(n_phi),
645 flux = RealVectorX::Zero(dim),
646 vel = RealVectorX::Zero(dim);
648 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > conductance =
651 std::vector<MAST::FEMOperatorMatrix> dBmat(dim);
658 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
662 for (
unsigned int i=0; i<dim; i++)
663 vn += vel(i)*face_normals[qp](i);
668 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
678 (*conductance)(xyz[qp],
_time, material_mat);
685 for (
unsigned int j=0; j<dim; j++) {
686 dBmat[j].right_multiply(vec1,
_sol);
688 for (
unsigned int i=0; i<dim; i++)
689 flux(i) += vec1(0) * material_mat(i,j);
693 for (
unsigned int i=0; i<dim; i++) {
695 dBmat[i].vector_mult_transpose(vec2_n2, vec1);
696 f += JxW_Vn[qp] * vec2_n2;
714 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
716 const std::vector<Real>& JxW = fe->get_JxW();
717 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
720 n_phi = fe->n_shape_functions(),
724 material_mat = RealMatrixX::Zero(dim, dim),
725 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi),
726 local_jac_xdot = RealMatrixX::Zero(n_phi, n_phi);
729 vec1 = RealVectorX::Zero(1),
730 vec2_n2 = RealVectorX::Zero(n_phi),
731 local_f = RealVectorX::Zero(n_phi);
733 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > capacitance =
736 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
750 local_f += JxW[qp] * material_mat(0,0) * vec2_n2;
755 local_jac_xdot += JxW[qp] * material_mat(0,0) * mat_n2n2;
761 for (
unsigned int i=0; i<local_jac_xdot.rows(); i++) {
763 Real a = local_jac_xdot.row(i).sum();
764 local_jac_xdot.row(i).setZero();
765 local_jac_xdot(i,i) = a;
768 f += local_jac_xdot *
_vel;
785 const unsigned int s,
791 std::vector<Real> JxW_Vn = fe->get_JxW();
792 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
793 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
798 n_phi = fe->n_shape_functions(),
802 material_mat = RealMatrixX::Zero(dim, dim),
803 mat_n2n2 = RealMatrixX::Zero(n_phi, n_phi),
804 local_jac_xdot = RealMatrixX::Zero(n_phi, n_phi);
806 vec1 = RealVectorX::Zero(1),
807 vec2_n2 = RealVectorX::Zero(n_phi),
808 local_f = RealVectorX::Zero(n_phi),
809 vel = RealVectorX::Zero(dim);
811 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > capacitance =
818 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
822 for (
unsigned int i=0; i<dim; i++)
823 vn += vel(i)*face_normals[qp](i);
827 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
836 (*capacitance)(xyz[qp],
_time, material_mat);
841 local_f += JxW_Vn[qp] * material_mat(0,0) * vec2_n2;
846 local_jac_xdot += JxW_Vn[qp] * material_mat(0,0) * mat_n2n2;
853 for (
unsigned int i=0; i<local_jac_xdot.rows(); i++) {
855 Real a = local_jac_xdot.row(i).sum();
856 local_jac_xdot.row(i).setZero();
857 local_jac_xdot(i,i) = a;
860 f += local_jac_xdot *
_vel;
880 const unsigned int s,
892 const std::vector<Real> &JxW = fe->get_JxW();
893 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
894 const std::vector<std::vector<Real> >& phi = fe->get_phi();
895 const unsigned int n_phi = (
unsigned int)phi.size();
900 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
903 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
904 phi_vec(i_nd) = phi[i_nd][qp];
907 func(qpoint[qp],
_time, flux);
908 if (section) (*section)(qpoint[qp],
_time, th);
911 f += JxW[qp] * phi_vec * flux * th;
930 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
932 const std::vector<Real> &JxW = fe->get_JxW();
933 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
934 const std::vector<std::vector<Real> >& phi = fe->get_phi();
935 const unsigned int n_phi = (
unsigned int)phi.size();
940 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
943 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
944 phi_vec(i_nd) = phi[i_nd][qp];
947 func(qpoint[qp],
_time, flux);
949 f += JxW[qp] * phi_vec * flux;
960 const unsigned int s,
973 const std::vector<Real> &JxW = fe->get_JxW();
974 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
975 const std::vector<std::vector<Real> >& phi = fe->get_phi();
976 const unsigned int n_phi = (
unsigned int)phi.size();
979 Real flux, dflux, th, dth;
981 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
984 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
985 phi_vec(i_nd) = phi[i_nd][qp];
988 func(qpoint[qp],
_time, flux);
989 func.derivative(p, qpoint[qp],
_time, dflux);
992 (*section)(qpoint[qp],
_time, th);
993 section->derivative(p, qpoint[qp], _time, dth);
1000 f += JxW[qp] * phi_vec * (flux*dth + dflux*th);
1017 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1019 const std::vector<Real> &JxW = fe->get_JxW();
1020 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1021 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1022 const unsigned int n_phi = (
unsigned int)phi.size();
1027 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1030 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1031 phi_vec(i_nd) = phi[i_nd][qp];
1036 f += JxW[qp] * phi_vec * flux;
1046 const unsigned int s,
1054 std::vector<Real> JxW_Vn = fe->get_JxW();
1055 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1056 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1057 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1059 n_phi = (
unsigned int)phi.size(),
1063 phi_vec = RealVectorX::Zero(n_phi),
1064 vel = RealVectorX::Zero(dim);
1071 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1075 for (
unsigned int i=0; i<dim; i++)
1076 vn += vel(i)*face_normals[qp](i);
1085 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1088 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1089 phi_vec(i_nd) = phi[i_nd][qp];
1092 func(xyz[qp],
_time, flux);
1094 f += JxW_Vn[qp] * phi_vec * flux;
1104 const unsigned int s,
1116 const std::vector<Real> &JxW = fe->get_JxW();
1117 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1118 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1119 const unsigned int n_phi = (
unsigned int)phi.size();
1123 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1124 Real temp, amb_temp, h_coeff, th;
1128 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1131 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1132 phi_vec(i_nd) = phi[i_nd][qp];
1135 coeff(qpoint[qp],
_time, h_coeff);
1136 T_amb(qpoint[qp],
_time, amb_temp);
1137 temp = phi_vec.dot(
_sol);
1138 if (section) (*section)(qpoint[qp],
_time, th);
1144 f += JxW[qp] * phi_vec * th* h_coeff * (temp - amb_temp);
1146 if (request_jacobian) {
1150 jac += JxW[qp] * mat * th * h_coeff;
1172 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1174 const std::vector<Real> &JxW = fe->get_JxW();
1175 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1176 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1177 const unsigned int n_phi = (
unsigned int)phi.size();
1181 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1182 Real temp, amb_temp, h_coeff;
1186 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1189 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1190 phi_vec(i_nd) = phi[i_nd][qp];
1193 coeff(qpoint[qp],
_time, h_coeff);
1194 T_amb(qpoint[qp],
_time, amb_temp);
1195 temp = phi_vec.dot(
_sol);
1200 f += JxW[qp] * phi_vec * h_coeff * (temp - amb_temp);
1202 if (request_jacobian) {
1206 jac += JxW[qp] * mat * h_coeff;
1220 const unsigned int s,
1232 const std::vector<Real> &JxW = fe->get_JxW();
1233 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1234 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1235 const unsigned int n_phi = (
unsigned int)phi.size();
1239 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1241 temp, amb_temp, h_coeff, th,
1242 damb_temp, dh_coeff, dth;
1246 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1249 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1250 phi_vec(i_nd) = phi[i_nd][qp];
1253 coeff(qpoint[qp],
_time, h_coeff);
1254 T_amb(qpoint[qp],
_time, amb_temp);
1255 coeff.derivative(p, qpoint[qp],
_time, dh_coeff);
1256 T_amb.derivative(p, qpoint[qp],
_time, damb_temp);
1259 (*section)(qpoint[qp],
_time, th);
1260 section->derivative(p, qpoint[qp], _time, dth);
1266 temp = phi_vec.dot(
_sol);
1271 f += JxW[qp] * phi_vec * (th * dh_coeff * (temp - amb_temp) +
1272 th * h_coeff * (-damb_temp) +
1273 dth* h_coeff * (temp - amb_temp));
1291 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1293 const std::vector<Real> &JxW = fe->get_JxW();
1294 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1295 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1296 const unsigned int n_phi = (
unsigned int)phi.size();
1300 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1302 temp, amb_temp, h_coeff,
1303 damb_temp, dh_coeff;
1307 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1310 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1311 phi_vec(i_nd) = phi[i_nd][qp];
1314 coeff(qpoint[qp],
_time, h_coeff);
1315 T_amb(qpoint[qp],
_time, amb_temp);
1317 T_amb.derivative(p, qpoint[qp],
_time, damb_temp);
1318 temp = phi_vec.dot(
_sol);
1323 f += JxW[qp] * phi_vec * (dh_coeff * (temp - amb_temp)+
1324 h_coeff * (-damb_temp));
1335 const unsigned int s,
1342 std::vector<Real> JxW_Vn = fe->get_JxW();
1343 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1344 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1345 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1353 n_phi = (
unsigned int)phi.size(),
1358 phi_vec = RealVectorX::Zero(n_phi),
1359 vel = RealVectorX::Zero(dim);
1361 mat = RealMatrixX::Zero(n_phi, n_phi);
1363 Real temp, amb_temp, h_coeff;
1371 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1375 for (
unsigned int i=0; i<dim; i++)
1376 vn += vel(i)*face_normals[qp](i);
1380 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1383 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1384 phi_vec(i_nd) = phi[i_nd][qp];
1387 coeff(xyz[qp],
_time, h_coeff);
1388 T_amb(xyz[qp],
_time, amb_temp);
1389 temp = phi_vec.dot(
_sol);
1394 f += JxW_Vn[qp] * phi_vec * h_coeff * (temp - amb_temp);
1407 const unsigned int s,
1424 const std::vector<Real> &JxW = fe->get_JxW();
1425 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1426 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1427 const unsigned int n_phi = (
unsigned int)phi.size();
1430 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1434 zero_ref = T_ref_zero();
1435 Real temp, emiss, th;
1438 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1441 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1442 phi_vec(i_nd) = phi[i_nd][qp];
1445 emissivity(qpoint[qp],
_time, emiss);
1446 temp = phi_vec.dot(
_sol);
1447 if (section) (*section)(qpoint[qp],
_time, th);
1450 f += JxW[qp] * phi_vec * sbc * emiss * th *
1451 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1453 if (request_jacobian) {
1457 jac += JxW[qp] * mat * sbc * emiss * th * 4. * pow(temp+zero_ref, 3.);
1481 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1483 const std::vector<Real> &JxW = fe->get_JxW();
1484 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1485 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1486 const unsigned int n_phi = (
unsigned int)phi.size();
1489 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1493 zero_ref = T_ref_zero();
1497 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1500 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1501 phi_vec(i_nd) = phi[i_nd][qp];
1504 emissivity(qpoint[qp],
_time, emiss);
1505 temp = phi_vec.dot(
_sol);
1507 f += JxW[qp] * phi_vec * sbc * emiss *
1508 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1510 if (request_jacobian) {
1514 jac += JxW[qp] * mat * sbc * emiss * 4. * pow(temp+zero_ref, 3.);
1527 const unsigned int s,
1545 const std::vector<Real> &JxW = fe->get_JxW();
1546 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1547 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1548 const unsigned int n_phi = (
unsigned int)phi.size();
1551 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1555 zero_ref = T_ref_zero();
1556 Real temp, emiss, demiss, th, dth;
1559 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1562 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1563 phi_vec(i_nd) = phi[i_nd][qp];
1566 emissivity(qpoint[qp],
_time, emiss);
1567 emissivity.derivative(p, qpoint[qp],
_time, demiss);
1568 temp = phi_vec.dot(
_sol);
1571 (*section)(qpoint[qp],
_time, th);
1572 section->derivative(p, qpoint[qp], _time, dth);
1579 f += JxW[qp] * phi_vec * sbc * (demiss * th + emiss * dth) *
1580 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1602 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1604 const std::vector<Real> &JxW = fe->get_JxW();
1605 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1606 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1607 const unsigned int n_phi = (
unsigned int)phi.size();
1610 RealMatrixX mat = RealMatrixX::Zero(n_phi, n_phi);
1614 zero_ref = T_ref_zero();
1618 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1621 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1622 phi_vec(i_nd) = phi[i_nd][qp];
1626 temp = phi_vec.dot(
_sol);
1628 f += JxW[qp] * phi_vec * sbc * demiss *
1629 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1638 const unsigned int s,
1645 std::vector<Real> JxW_Vn = fe->get_JxW();
1646 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1647 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1648 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1660 n_phi = (
unsigned int)phi.size(),
1664 phi_vec = RealVectorX::Zero(n_phi),
1665 vel = RealVectorX::Zero(dim);
1667 mat = RealMatrixX::Zero(n_phi, n_phi);
1672 zero_ref = T_ref_zero();
1683 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1687 for (
unsigned int i=0; i<dim; i++)
1688 vn += vel(i)*face_normals[qp](i);
1692 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1695 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1696 phi_vec(i_nd) = phi[i_nd][qp];
1699 emissivity(xyz[qp],
_time, emiss);
1700 temp = phi_vec.dot(
_sol);
1702 f += JxW_Vn[qp] * phi_vec * sbc * emiss *
1703 (pow(temp+zero_ref, 4.) - pow(amb_temp+zero_ref, 4.));
1722 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1724 const std::vector<Real> &JxW = fe->get_JxW();
1725 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1726 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1727 const unsigned int n_phi = (
unsigned int)phi.size();
1732 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1735 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1736 phi_vec(i_nd) = phi[i_nd][qp];
1739 func(qpoint[qp],
_time, source);
1740 if (section) (*section)(qpoint[qp],
_time, th);
1743 f -= JxW[qp] * phi_vec * source * th;
1760 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
false,
false));
1762 const std::vector<Real> &JxW = fe->get_JxW();
1763 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1764 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1765 const unsigned int n_phi = (
unsigned int)phi.size();
1768 Real source, dsource, th, dth;
1770 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1773 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1774 phi_vec(i_nd) = phi[i_nd][qp];
1777 func(qpoint[qp],
_time, source);
1781 (*section)(qpoint[qp],
_time, th);
1782 section->derivative(p, qpoint[qp], _time, dth);
1789 f -= JxW[qp] * phi_vec * (dsource * th + source * dth);
1798 const unsigned int s,
1805 std::vector<Real> JxW_Vn = fe->get_JxW();
1806 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1807 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1808 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1816 n_phi = (
unsigned int)phi.size(),
1820 phi_vec = RealVectorX::Zero(n_phi),
1821 vel = RealVectorX::Zero(dim);
1828 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1832 for (
unsigned int i=0; i<dim; i++)
1833 vn += vel(i)*face_normals[qp](i);
1837 for (
unsigned int qp=0; qp<xyz.size(); qp++) {
1840 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1841 phi_vec(i_nd) = phi[i_nd][qp];
1844 func(xyz[qp],
_time, source);
1845 if (section) (*section)(xyz[qp],
_time, th);
1848 f -= JxW_Vn[qp] * phi_vec * source * th;
1861 const std::vector<std::vector<Real> >& phi_fe = fe.
get_phi();
1863 const unsigned int n_phi = (
unsigned int)phi_fe.size();
1869 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1870 phi(i_nd) = phi_fe[i_nd][qp];
1881 const unsigned int dim,
1883 std::vector<MAST::FEMOperatorMatrix>& dBmat) {
1885 libmesh_assert(dBmat.size() == dim);
1887 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
1889 const unsigned int n_phi = (
unsigned int)dphi.size();
1893 for (
unsigned int i_dim=0; i_dim<dim; i_dim++) {
1895 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1896 phi(i_nd) = dphi[i_nd][qp](i_dim);
1897 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 .
MAST::FunctionBase * _active_sol_function
pointer to the active solution mesh field function.
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...
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 const libMesh::Elem & get_reference_elem() const
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.
virtual const MAST::FieldFunction< Real > * section(const MAST::ElementBase &e) const =0
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...
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...
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
virtual const std::vector< std::vector< Real > > & get_phi() const
virtual void internal_residual_sensitivity(const MAST::FunctionBase &p, RealVectorX &f)
sensitivity of the internal force contribution to system residual
HeatConductionElementBase(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
Constructor.
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...
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 ...
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 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
void right_multiply(T &r, const T &m) const
[R] = [this] * [M]
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
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
Matrix< Real, Dynamic, 1 > RealVectorX
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
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.
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
RealVectorX _sol
local solution
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
bool if_diagonal_mass_matrix() const
returns the type of strain to be used for this element
virtual ~HeatConductionElementBase()
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
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
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 std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
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 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 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
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
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 ...