Dear Shahin, dear Wolfgang,
I had a closer look into the technical details. The implementation with
regard to deal.II functionalities is fine. Only for
the nonlinear AFC method, the algorithm needs to be worked out.
Best regards,
Thomas
--
---
++++--------------------------------------------++++
Prof. Dr. Thomas Wick
Leibniz Universität Hannover (LUH)
Institut für Angewandte Mathematik (IfAM)
Arbeitsgruppe Wissenschaftliches Rechnen (GWR)
Welfengarten 1
30167 Hannover, Germany
Tel.: +49 511 762 3360
Email: [email protected]
www: https://ifam.uni-hannover.de/wick
www: https://thomaswick.org
++++--------------------------------------------++++
---
--
Am 16.12.21 um 21:04 schrieb Wolfgang Bangerth:
On 12/10/21 03:23, Shahin Heydari wrote:
raw_flux_matrix(i,j) =
mass_matrix(i,j) * (solution_ul(i) - solution_ul(j))
-
mass_matrix(i,j) * (old_solution_u(i) - old_solution_u(j))
-
time_step * theta * matrix_D(i,j) * (solution_ul(i) -
solution_ul(j))
-
time_step * (1-theta) * matrix_D(i,j) * (old_solution_u(i) -
old_solution_u(j));
but the obtained solution is very smeared and the solution does not
do one complete rotation as it supposed to do. I think the problem
might be that I have made a mistake in computing mij, dij and ul in
the global indices.
I suspect that you won't get anyone here who has the interest,
knowledge, and time to go through your code to check out what is the
problem. So it comes down to how you can debug the problem and my
suggestion always is to pick simple cases: For example, choose an
initial condition that is a step function and for which you can
compute everything on a piece of paper, run one time step, and compare
what you get with what you expected.
In any case, the code snippet you show that loops through the matrix
entries is at least conceptually correct, though I will point out that
this...
for(auto jt = sparsity_pattern.begin(i); jt !=
sparsity_pattern.end(i); jt++);
const auto j = jt->column();
...looks funny to me: The semicolon at the end of the for(...); line
means that the loop has an empty loop body. But then the variable 'jt'
would not actually live outside the loop body, and I would have
expected that you get an error message in the second line. In any
case, the following line that computes raw_flux_matrix is not within
the loop body because there are no curly braces, and so does not seem
to be executed for every 'j'. That doesn't seem right, but I infer
that the code does not compile that way, and so it must not be exactly
what you have in your code.
As I know, when we are inside the cell and want to access the value
of global matrix or vector we can compute the value at the quadrature
point for example as follow:
std::vector<double> old_solution_u_values(n_q_points);
fe_values.get_function_values(old_solution_u , old_solution_u_values);
I don't get that comment. I thought you were just working with nodal
values of the solution for the AFC. Why do you need the values at
quadrature points?
Now I am just wondering how I can access the entry of the global
matrix and vector in this case.
And I don't understand this question because you have already figured
this out.
Best
W.
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/7bbd3d1a-829e-486d-a9c2-02134ba29b18%40gmail.com.