From: li pan <li76pan@ya...>  20060620 08:41:20

thanx Roy, it works with static test. But I still have problem with dynamic test, because there are more matrices and vectors (stiffness, mass, force, displacement, velocity and acceleration). The true system.matrix and system.rhs are all effective one. They will be calculated after assembly. Only mass, stiffness and force are assembled. So I called dof_map.constrain_XXXX for those three and got the following error. Hereby, one thing seems odd for is both stiffness and mass have value at diagonal number 3035, but system.matrix doesn't. system.matrix=stiffness+A0*mass (A0 is a constant scale coefficient) [0]PETSC ERROR: MatMissingDiagonal_SeqAIJ() line 998 in src/mat/impls/aij/seq/aij.c [0]PETSC ERROR: Petsc has generated inconsistent data! [0]PETSC ERROR: Matrix is missing diagonal number 3035! [0]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ() line 886 in src/mat/impls/aij/seq/aijfact.c [0]PETSC ERROR: MatILUFactorSymbolic() line 4312 in src/mat/interface/matrix.c [0]PETSC ERROR: PCSetUp_ILU() line 779 in src/ksp/pc/impls/factor/ilu/ilu.c [0]PETSC ERROR: PCSetUp() line 798 in src/ksp/pc/interface/precon.c [0]PETSC ERROR: KSPSetUp() line 234 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: KSPSolve() line 332 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: User provided function() line 288 in unknowndirectory/src/numerics/petsc_linear_solver.C On Mon, 19 Jun 2006, li pan wrote: > I used error estimator and mesh refinement for the > first time. I wonder how to define the three > attributes, namely, refine_fraction, coarsen_fraction, > and max_level. I think for special problem, the value > must be different. I did some test. Tried with > different combination. The Newton iteration which > converged without mesh refinement well before, can't > converge with some refinement. What could likely be > the reason? Well, the reason that just killed one of our visitors to UT Austin is simple: In the matrix assembly stage, after you've built the local dense matrix and vector for a given cell, but before you add them to the global sparse matrix and vector, you need to call something like: dof_map.constrain_element_matrix_and_vector(Ke, Fe, dof_indices); We really need to get some code into libMesh to warn users about this potential error, but I'm not sure how to do it. Maybe a static boolean in DofMap that initializes to false, gets turned on by the constrain_* member functions, and then gets tested by the System::solve functions whenever DofMap::n_constrained_dofs() > 0? The other theoretical problem with a Newton iteration is that if you're solving for the delta between Newton iterates, it may be possible that an inexact linear solve will give you illconstrained hanging DoFs and that subsequent Newton steps will be unable to correct them. I call this a "theoretical problem" because I've never seen it in practice, but I think I may code a DofMap::enforce_constraints() method (to be called by System::solve after the linear solver is done) to be safe in the future.  Roy Stogner __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com 