Dear Helmut,
what you are describing is usually referred to as mixed or Robin boundary condition. Please have a look at the recent thread on albedo boundary conditions.
Best,
Guido
for (; cell != endc; ++cell)
{
fe_values.reinit(cell);
cell_matrix = 0;
cell_rhs = 0;
for (unsigned int i = 0; i < dofs_per_cell; ++i)
for (unsigned int j = 0; j < dofs_per_cell; ++j)
for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
cell_matrix(i, j) += (fe_values.shape_grad(i, q_point)
* fe_values.shape_grad(j, q_point)
* fe_values.JxW(q_point));
for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face)
if (cell->face(face)->at_boundary() && (cell->face(face)->boundary_indicator() == 1))
{
fe_face_values.reinit(cell, face);
for (unsigned int i = 0; i < dofs_per_face; ++i)
for (unsigned int j = 0; j < dofs_per_face; ++j)
for (unsigned int q_point = 0; q_point < n_face_q_points;
++q_point)
{
// on boundary 1 : h*(theta_s - theta_e)
cell_matrix(i, j) += 1 / R_SI_1
* ((fe_face_values.shape_value(i, q_point)
* fe_face_values.shape_value(j, q_point))
* fe_face_values.JxW(q_point) - THETA_1);
}
}
((fe_face_values.shape_value(i, q_point) * fe_face_values.shape_value(j, q_point)) * fe_face_values.JxW(q_point)
std::map<unsigned int, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler, 0, ConstantFunction<2>(1), boundary_values);
MatrixTools::apply_boundary_values(boundary_values, system_matrix, solution, system_rhs);
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
neumann = 1.0 / R_SI_1 * (THETA_1 - myOldValues[q_point]); // calculated outside loop
...
for (unsigned int i = 0; i < dofs_per_cell; ++i)
cell_rhs(i) += neumann * fe_face_values.shape_value(i, q_point) * fe_face_values.JxW(q_point);
for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face)
if (cell->face(face)->at_boundary() && (cell->face(face)->boundary_indicator() == 1))
{
fe_face_values.reinit(cell, face);
for (unsigned int i = 0; i < dofs_per_cell; ++i) //
for (unsigned int j = 0; j < dofs_per_cell; ++j)
for (unsigned int q_point = 0; q_point < n_face_q_points; ++q_point)
cell_matrix(i, j) += 1 / R_SI_1* fe_face_values.shape_value(i, q_point) * fe_face_values.shape_value(j, q_point) * fe_face_values.JxW(q_point);
for (unsigned int j = 0; j < dofs_per_cell; ++j)
for (unsigned int q_point = 0; q_point < n_face_q_points; ++q_point)
cell_rhs(j) += 1/ R_SI_1 * THETA_1 * fe_face_values.shape_value(j, q_point) * fe_face_values.JxW(q_point);
}