Martin Stoll wrote:
> Hi,
>
> I have the following question which will probably be trivial to most
> of you. I am writing a program for involving Stokes flow, for that I
> essentially followed mainly step-22 of the tutorial.
> As one of the testcases now I want to use the driven cavity which
> means Dirichlet everywhere on the whole domain. My issue which is
> probably just me being stupid is now how to implement this
> efficiently.
>
> My first attempt inspired by step-22 was
>
> std::vector<bool> component_mask (dim+1, true);
> component_mask[dim] = false;
> VectorTools::interpolate_boundary_values (dof_handler,
> 1,
> BoundaryValues<dim>(),
> hanging_node_constraints,
> component_mask);
>
> and then later after assembly
>
> hanging_node_constraints.condense (system_matrix, system_rhs); (I know
> the local distribution would be better).
>
> This procedure does not give me a consistens right hand side as the
> part g in rhs=[b;g]'; does not satisfy
> (g,1)=0;
>
> Here is the boundary function
>
> BoundaryValues<dim>::value (const Point<dim> &p,
> const unsigned int component) const
> {
> if (p[1]==1)
> return 1;
> return 0;
> }
>
using this you get velocity v = (1,1) at the boundary y = 1 since you
return 1 for all components. I assume you want v = (1, 0). Try
if (p[1] == 1 && component == 0)
Furthermore p[1] == 1 is not very safe when using floating point
numbers. It should work in this case but in general you should prefer
std::abs(p[1] - 1) < very_small_value.
Johannes
> If I understand the component_mask properly then the Boundary value
> function shouldn't be called for the pressure values.
>
> Where is it that I am going wrong? Any help is greatly appreciated.
>
> Best,
> Martin
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii