[deal.II] Velocity laplacians
Dear all, I hope everyone is safe and healthy. I am currently implementing the entropy viscosity model (see Guermond et al., J. Sci. Comput. 49:35–50 (2011)), which is similar to the artificial viscosity model introduced in step-31 for the transient advection-diffusion equation for temperature. However, in this case, the viscosity is for the momentum equation. Since I have to compute the residual of the momentum equation, I need to obtain the viscous terms, which in turn involves the computation of the velocity Laplacians. So far I have done the following: 1. Added the "update_hessians" flag in "UpdateFlags(update_q_points | update_values | update_gradients | update_hessians | update_JxW_values)" 2. Created an object "laplacian_velocity_cell_old" and resized it according to the number of quadrature points in the cell. 3. Filled the object using the "get_function_laplacians" function in deal.ii. However, I am getting "-nan" in some of the cells, and I am not sure that my procedure is correct. Could you please tell me what am I missing? Thank you! Alex -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/44bcc81c-9767-4be7-a0c3-7d41d21d02f3n%40googlegroups.com.
Re: [deal.II] Step-22 with more than 20 million DOFs
Hi Wolfgang, thank you for your reply. I will look at the extensions of step-22, as well as the parallelization of the code detailed in step-32. Cheers, Alex El divendres, 26 juny de 2020 10:24:20 UTC-6, Wolfgang Bangerth va escriure: > > > Alex, > > > I am solving the Stokes flow problem in three dimensions using OpenFCST > > < > https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.openfcst.mece.ualberta.ca%2F=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Ccd3182fe6dfc4066e6b208d81897e47a%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C1%7C637286387952996923=5F%2BU95iUemz1oaDHrEaZ8C3xevwIzmoSqrI3UMU%2F2%2FA%3D=0>, > > > > which is an open-source platform for fuel cell simulations and it is > based on > > deal.II v8.4.1. The code that I use is mostly based on the code in > Step-22, > > and I have noticed that my simulations fail when my mesh has more than > 20 > > million DOFs. In order to check if the problem comes from deal.ii and > not from > > OpenFCST, I did the following: > > > > 1. Modified slightly the code in step-22 (see file "step-22.cc" > attached) to > > consider a domain in 3D that is of size 100x100x50 and it has 50 > divisions per > > direction. > > 2. Applied the same boundary conditions that are applied in step-22 > > 4. Ran the simulation both in deal.II v8.4.1 and v.9.0.1 with less than > 20 > > million DOFs, and I was able to obtain a solution (see file > "DealII_test.png" > > attached). > > 5. Ran the simulation in deal.II v8.4.1 -> it resulted in a > "Segmentation > > fault" error (see file "output_v8_4_1.out"). > > 5. Ran the simulation in deal.II v9.0.1 -> it resulted in a "nan > residual" > > error (see file "output_v9_0_1.out"). > > > > I was wondering if someone could please tell me why this issue is > appearing > > when I consider a mesh with more than 20 million DOFs, and if there is a > > solution to this. > > 20 million unknowns is quite a large number, especially if you are using > the > solver used in step-22. My suspicion is that in both cases, the error > message > really just points out that you're run out of memory. > > It would be interesting to see how your program's memory use increases as > you > go from smaller to large problems. I suspect that you will see that for 20 > million unknowns on a single machine, you will need ~100GB of memory and > that > that exceeds what the operating system is willing to give you. > > 20 million unknowns is solidly in the region where you need (i) a parallel > machine, and (ii) a better linear solver than the one used in step-22. > Both > exist in deal.II: a better linear solver is discussed in the > "Possibilities > for extensions" of step-22, and is implemented in a parallel fashion in > step-32 among others. > > Best > W. > > -- > > Wolfgang Bangerth email: bang...@colostate.edu > > www: http://www.math.colostate.edu/~bangerth/ > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/224ca173-bae2-494f-9c52-3ea19251e5b0o%40googlegroups.com.
Re: [deal.II] Copy blocks of BlockSparseMatrix
Hi Daniel, thanks for your kind reply. I apologize for not giving more details about my code. In the file where the global matrix (m33) and its sparsity pattern is created, I also include the declaration and initialization of the new matrix (m22). After that, the new matrix is of size 2x2 blocks. Then, I simply copy the sparsity pattern of each block of matrix m33 to the blocks of matrix m22 as: for (int i = 0; i < dim; i++) { for (int j = 0; j < dim; j++) { m22.block(i,j).reinit(m33.block(i+1,j+1).get_sparsity_pattern()); m22.block(i,j).copy_from(m33.block(i+1,j+1)); } } The error appears on the next step, when I try to initialize the preconditioner with matrix m22: SparseDirectUMFPACK preconditioner; preconditioner.initialize (A_mat, SparseDirectUMFPACK::AdditionalData()); The exact error message that I get in debug mode is the following: An error occurred in line <272> of file in function void dealii::SparseDirectUMFPACK::factorize(const Matrix&) [with Matrix = dealii::BlockSparseMatrix] The violated condition was: row_pointers[i] == Ap[i+1] The name and call sequence of the exception was: ExcInternalError() Additional Information: This exception -- which is used in many places in the library -- usually indicates that some condition which the author of the code thought must be satisfied at a certain point in an algorithm, is not fulfilled. An example would be that the first part of an algorithm sorts elements of an array in ascending order, and a second part of the algorithm later encounters an an element that is not larger than the previous one. There is usually not very much you can do if you encounter such an exception since it indicates an error in deal.II, not in your own program. Try to come up with the smallest possible program that still demonstrates the error and contact the deal.II mailing lists with it to obtain help. I cannot understand why the initialization of the blocks of matrix m22 is not working properly.. Thanks for your help. Cheers, Alex On Monday, October 16, 2017 at 9:03:05 AM UTC-6, Daniel Arndt wrote: > > Alex, > > Hi all, >> >> I am having a similar problem. I want to take a 3x3 BlockSparseMatrix m33 >> and copy four of its blocks into a 2x2 BlockSparseMatrix m22. For instance: >> >> m33 = [ A B C >> D E F >> G H I ] >> >> From this matrix, I would like to obtain the following: >> >> m22 = [ E F >> H I ] >> >> Timo, I have tried the solutions that you suggest, but none of them work, >> I keep getting a segmentation fault error. Could you please give me an >> alternative option? >> > What exactly are you doing and what is the exact error message you are > getting in debug mode? > Do the sparsity patterns already match before copying? > > Best, > Daniel > > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.