Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

mfem

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Strongly Enforcing BCs by FormLinearSystem#4759

Unanswered
Raminpahnabi asked this question inQ&A
Discussion options

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:

  1. 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?
  2. 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)?
  3. 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?
You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@Raminpahnabi

[8]ページ先頭

©2009-2025 Movatter.jp