Hi,
I am trying to change the boundary condition for the stokes equation from p = g
to u.n = 0 on all the boundaries in step 21. I am trying to use
no_normal_flux_boundary_conditions. These are the changes I made. Top one/two
lines in each change are unaltered. I just mention them to give a sense of
where I made the change.
1. dof_handler.distribute_dofs (fe);
DoFRenumbering::component_wise (dof_handler);
// Code Change Start: constraints to put no normal flux bcs
stokes_constraints.clear();
std::set<unsigned char> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert (0);
VectorTools::compute_no_normal_flux_constraints (dof_handler,0,
no_normal_flux_boundaries,
stokes_constraints);
stokes_constraints.close();
// Code Change End
2. sparsity_pattern.collect_sizes();
// Code Change Start: Constraints no normal flux bcs fixed right at the
beginning
DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern,
stokes_constraints,false);
// Code Change End
3. // The final step in the loop
// over all cells is to
// transfer local contributions
// into the global matrix and
// right hand side vector:
cell->get_dof_indices (local_dof_indices);
//Code Change Start: Use Constraint Matrix to enter local contributions to
global matrix
stokes_constraints.distribute_local_to_global (local_matrix,
local_rhs,
local_dof_indices,
system_matrix,
system_rhs);
/* for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
system_matrix.add (local_dof_indices[i],
local_dof_indices[j],
local_matrix(i,j));
for (unsigned int i=0; i<dofs_per_cell; ++i)
system_rhs(local_dof_indices[i]) += local_rhs(i);*/
//Code Change End
}
I get this error when I make these changes.
An error occurred in line <2719> of file
</users/stirupat/Research/Software/deal.II/deal.II/include/fe/fe.h> in function
std::pair<unsigned int, unsigned int> dealii::FiniteElement<dim,
spacedim>::face_system_to_component_index(unsigned int) const [with int dim =
2, int spacedim = 2]
The violated condition was:
is_primitive(this->face_to_equivalent_cell_index(index))
The name and call sequence of the exception was:
(typename FiniteElement<dim,spacedim>::ExcShapeFunctionNotPrimitive(index))
Additional Information:
The shape function with index 0 is not primitive, i.e. it is vector-valued and
has more than one non-zero vector component. This function cannot be called for
these shape functions. Maybe you want to use the same function with the
_component suffix?
Stacktrace:
-----------
#0 /users/stirupat/Research/Software/deal.II/lib/libdeal_II_2d.g.so.6.2.1:
dealii::FiniteElement<2, 2>::face_system_to_component_index(unsigned int) const
#1 /users/stirupat/Research/Software/deal.II/lib/libdeal_II_2d.g.so.6.2.1:
void dealii::VectorTools::compute_no_normal_flux_constraints<2,
dealii::DoFHandler, 2>(dealii::DoFHandler<2, 2> const&, unsigned int,
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char>
> const&, dealii::ConstraintMatrix&, dealii::Mapping<2, 2> const&)
#2 ./step-21: TwoPhaseFlowProblem<2>::make_grid_and_dofs()
#3 ./step-21: TwoPhaseFlowProblem<2>::run()
#4 ./step-21: main
--------------------------------------------------------
make: *** [run] Aborted
Can anyone help me with this error, my approach or a better way to impose
neumann bcs.
Thanks a lot,
Seshu
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii