Denis, thanks a lot for your answer and links that you provided.
However, my solution becomes in a way that the displacement values on that
boundary abnormally grow
even without assigning new boundary condition in a time loop. I attach
figures on the zero step (correct) and on the first step (wrong).
I do the following these things on each iteration:
1) recompute rhs vector - system_rhs (which is zero for my problem),
2) compute matrix terms that are on the dirichlet boundary:
for (auto cell = dof_handler.begin_active(); cell!=dof_handler.end();
++cell) {
cell_matrix = 0; cell_rhs = 0; fe_values.reinit(cell);
for (unsigned int face_number=0;
face_number<GeometryInfo<dim>::faces_per_cell; ++face_number) {
if (cell->face(face_number)->at_boundary()) {
// boundary index
int id = cell->face(face_number)->boundary_id();
if (boundary_displacement.find(id) !=
boundary_displacement.end()) {
//compute cell_matrix
Then call function
hanging_node_constraints.distribute_local_to_global(cell_matrix, cell_rhs,
local_dof_indices, system_matrix, system_rhs);
3) Then apply functions to account Dirichlet boundary condition:
VectorTools::interpolate_boundary_values(dof_handler, boundary_id,
DirichletHandler, boundary_values);
MatrixTools::apply_boundary_values (boundary_values,
system_matrix,
solution,
system_rhs);
Can you give some advice how to make it correct?
<https://lh3.googleusercontent.com/-O_1geVdTAOc/Wo2eOCPcdWI/AAAAAAAAA44/s_OauNpGhwcv2d4h3nmBinL40UhP7-S7ACLcBGAs/s1600/iter0.jpg>
<https://lh3.googleusercontent.com/-wHZAFJbU0bI/Wo2egOHamAI/AAAAAAAAA5A/6QJqcgEqD8MiPR5DNLF34OWMF3qX9QZvQCLcBGAs/s1600/iter1.jpg>
On Tuesday, February 20, 2018 at 10:51:17 PM UTC+3, Denis Davydov wrote:
>
> Hi Ilya,
>
> I am not away of principally simple solution, the RHS simply contains your
> bilinear form times interpolated values at constrained DoFs.
> What you can do is to loop over a subset of cells (those which are at the
> boundary), still assemble the local matrix and do
> constraints.distribute_local_to_global() which takes global matrix and RHS.
>
> Or you can use constrained_linear_operator
> <https://www.dealii.org/developer/doxygen/deal.II/group__constraints.html#ga59c2f70370213d436cb9fade9d813478>,
>
> see this <https://groups.google.com/d/msg/dealii/A8dQs5i2n8A/YotvqvGwEgAJ>
> forum discussion.
>
> Please also study this
> <https://groups.google.com/d/msg/dealii/xo3Fa_olNwM/ObOuJPP2JT0J> thread,
> which covers similar question.
>
> Regards,
> Denis.
>
> On Tuesday, February 20, 2018 at 4:46:19 PM UTC+1, Bryukhanov Ilya wrote:
>>
>> Hi,
>>
>> I consider elastic problem and forces and displacements on boundaries are
>> changing with time. I don't want to compute FEM matrix
>> on each step. How to correctly simulate the task? I know that there is a
>> simple solution, but my solution is incorrect :)
>> I have two variables for the system_matrix and rhs_vector. I try to
>> recompute rhs_vector on each step and dirichlet condition
>> is accounted by calling "intepolate_boundary values +
>> apply_boundary_values" on each step with system_matrix and rhs_vector
>> variables inside.
>> I think that I should use initial matrix and the matrix which is modified
>> by Dirichlet procedure and assign latter to the initial matrix on each step?
>> Am I corrent or there is some other solution?
>>
>>
>>
>>
>>
>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.