From: <li...@si...> - 2018-05-24 11:30:06
|
Dear developers, I want to couple two variables into one system, one with the continuous FE type and the other with the discontinuous FE type. I tried system.add_variable ("p", FIRST, LAGRANGE); system.add_variable ("s", FIRST, L2_LAGRANGE); When inserting the neighbor matrix "Ken" for the second variable into the global stiffness matrix as in "example/miscellaneous_ex5", PETSc error reports that there is no MatrixPreallocation for inserting "Ken". But if I used L2_LAGRANGE for both variables, system.add_variable ("p", FIRST, L2_LAGRANGE); system.add_variable ("s", FIRST, L2_LAGRANGE); There is no error report. I believe the sparsity_patterns are different between LAGRANGE and L2_LAGRANGE. But right now I need to use different FE types for the two variable respectively. I don't know why it outputs error when I do the inserting of "Ken" ONLY for the second variable, which is already set to be L2_LAGRANGE. It seems that as long as one variable in the system is set to LAGRANGE, the whole Dof_map will build a sparsity_pattern based on the LAGRANGE type, even the other variable is set to L2_LAGRANGE type. It is hard for me to find such setting in the libmesh source codes such as dof_map.C. Best, Li Luo -----Original Messages----- From:"John Peterson" <jwp...@gm...> Sent Time:2018-05-17 00:19:38 (Thursday) To: "li.luo" <li...@si...> Cc: libmesh-users <lib...@li...> Subject: Re: [Libmesh-users] The use of MONOMIAL/XYZ FE_type On Wed, May 16, 2018 at 6:53 AM, <li...@si...> wrote: Dear developers, I tried using the MONOMIAL/XYZ FE_type as in the miscellaneous_ex5 example. After simplification under the choice of some parameters, my problem reduces to a Laplace equation with Dirichlet boundary condition. If a default FE_type is used (system.add_variable ("p", FIRST);), the Laplace problem outputs a right result, but if a MONOMIAL/XYZ FE_type is used instead (i.e. system.add_variable ("p", FIRST, XYZ)), the interior part is wrong, it isn't changed from its initial solution value (I set zero for the initial value), only the boundary is right due to the impose of Dirichlet condition. I have implemented the contribution of each element boundary flux as that in the miscellaneous_ex5 example. I don't know why it fails in the interior part. I'm not sure why XYZ would not work. It's possible that the solution is actually OK but the error arises in the ExodusII::write_discontinuous_exodusII() output? I don't think we have much testing of the XYZ FEType in libmesh or in apps which use libmesh, so it's possible that i regressed. 2. Another question is, if I want to couple two variables into one system, one with a default FE_type and the other with the MONOMIAL/XYZ FE_type, is that possible? I tried and found that when inserting the contribution of neighbor values into the matrix (as "Ken, Kne" in miscellaneous_ex5), PETSc error reports that --------------------------------------------------------------- Argument out of range! New nonzero at (13,33164) caused a malloc! MatSetValues_MPIAIJ() line 572 in src/mat/impls/aij/mpi/mpiaij.c MatSetValues() line 1106 in src/mat/interface/matrix.c add_matrix() line 699 in "unknowndirectory/"petsc_matrix.C --------------------------------------------------------------- It seems that different FE_types lead to different matrix preallocations, the MONOMIAL/XYZ FE_type allows the insert of Ken, Kne but the default FE_type does not. Can I use the same matrix preallocation for the two variables to allow such inserting? And you are using libmesh master? This is interesting, as we are discussing a similar error right now over on https://github.com/libMesh/libmesh/issues/1697 that might be related, although I suspect yours might have more to do with DG sparsity patterns. -- John -- Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences 1068 Xueyuan Avenue, Shenzhen University Town, Shenzhen, P. R. China Tel: +86 13691688103 Mail: li...@si... https://sites.google.com/site/rolyliluo/ |