I am trying to strongly enforce boundary conditions for a finite element problem whose solution will be found using GMRES. Assume that A is a matrix that has been populated from some assembly routine, rhs is the right-hand side which is also assembled previously, and subsequent variables are defined as below. Operator *ConstrainedSolve;Vector X, B;X = 0.0;A.FormLinearSystem(ess_tdof_list, x, rhs, ConstrainedSolve, X, B); GMRESSolver mySolver;mySolver.SetAbsTol(atol);mySolver.SetRelTol(rtol);mySolver.SetMaxIter(maxIter);mySolver.SetOperator(*ConstrainedSolve);mySolver.SetPrintLevel(1);mySolver.Mult(B, X);
Below is my understanding of the input values for the FormLinearSystem function: A.FormLinearSystem(ess_tdof_list, x, rhs, ConstrainedSolve, X, B) · A is a matrix, perhaps with non-empty nullspace · ess_tdof_list contains a list of DOF indices that are known a priori (and will be strongly enforced). This list, in particular, is important for getting rid of the nullspace of A. · x is a vector that is the same number of columns as A. The values of x in indices corresponding to those in ess_tdof_list are to be strongly enforced values. All other values in x (not corresponding to indices in ess_tdof_list) are ignored. · rhs contains the original values for the right-hand side. · ConstrainedSolve modifies A to have 0s in all rows and columns corresponding to indices of ess_tdof_list. The diagonal entries of A for these zero-ed out rows and columns are set based onDiagonalPolicy · X is the modified initial solution guess (which is frequently initialized to 0). · B is the modified right-hand side according to the strongly enforced values from ess_tdof_list and x. When x prescribes inhomgeneous data, B is also updated from rhs based on (zeroed out) data from A. Questions: - Is A.FormLinearSystem just setting up a constrained linear algebra problem? If A, x, ess_tdof_list, and rhs were just given as a matrix equation, would this operation function?
- Similarly, does the above have any connection to the originating finite element space, particularly with ess_tdof_list? Again, if this information did not come from a finite element assembly routine, could this find the solution to the system of equations (with constrained degrees of freedom)?
- After solving the problem with the above code snippet, I noticed that my boundaries are not strongly enforced, and the solution values in X corresponding to the indices in ess_tdof_list are not those as prescribed in x. If A in A.FormLinearSystem(ess_tdof_list, x, rhs, constrained, X, B) is poorly conditioned, could this result be expected?
|