Comments (4)
The differences you're encountering are because of the differences between "local vectors" (L-vectors) and "true vectors" (T-vectors).
A (Par)GridFunction is a "local vector" — it contains all the degrees of freedom for all the elements in the mesh partition. This means that degrees of freedom that lie on the boundary of the mesh partitions are shared (duplicated) among the MPI ranks of those partitions.
"True vectors" are vectors that contain only true DOFs (TDOFs). These are de-duplicated: every true DOF belongs to exactly one MPI rank.
When you call FormSystemMatrix
, the resulting matrix will act on true DOFs, so the dimensions will be less than the dimensions of the grid functions or linear forms.
To get a true DOF vector corresponding to a ParLinearForm, call the function ParLinearForm::ParallelAssemble
.
To extract a true DOF vector corresponding to a ParGridFunction, call the function ParGridFunction::ParallelProject
.
To covert a true DOF vector into a ParGridFunction, call the function ParGridFunction::Distribute
(or ParGridFunction::SetFromTrueDofs
— they are synonymous).
This diagram might help explain things:
There is also some documentation here.
from mfem.
It's clear now. Thank you @pazner .
from mfem.
Thank you @pazner, my current source is correct now with ParallelAssemble()
. I have 2 last questions.
- Is there something special about
HypreParVector
? I assume it's same as aVector
with true dofs size. ParallelProject
andParallelAssemble
calls
pfes->GetRestrictionMatrix()->Mult()
andpfes->GetProlongationMatrix()->Mult()Transpose
, respectively. Are they
equivalent?
from mfem.
- Is there something special about
HypreParVector
? I assume it's same as aVector
with true dofs size.
HypreParVector
is a Vector
with size equal to the number of true DOFs. It also wraps a hypre_ParVector
, which is an object from the hypre library that allows it to easily interface with hypre matrices and preconditioners. In most MFEM code, you can use Vector
instead of HypreParVector
.
ParallelProject
andParallelAssemble
calls
pfes->GetRestrictionMatrix()->Mult()
andpfes->GetProlongationMatrix()->Mult()Transpose
, respectively. Are they
equivalent?
ParallelAssemble
will perform assembly, in other words it will add contributions from shared processors. This is the right thing to do for dual vectors like linear forms. ParallelProject
will restrict the vector, meaning it will just take one of the shared values (if the code is consistent, all of the shared values will be equal, and it won't matter which one you take).
from mfem.
Related Issues (20)
- Add device tests of Example 14 (DG diffusion) HOT 3
- How to inverse block opeator matrix
- Possible memory leakage of HypreParMatrix HOT 2
- Evaluating integrals of shape functions in neighboring elements HOT 13
- 【VectorDomainLFIntegrator does not provided enough constructors】 HOT 3
- Changes to `socketbuf` result in `SocketStream` objects returning true even if not connected (e.g., to GLVis) HOT 5
- 【Is PWFunctionCoefficient possible?】 HOT 1
- Strange failure in LOBPCG::Solve() HOT 5
- Coefficient Projection for IGA Spaces HOT 5
- Apply double cross of a function by normal vector for Nedelec space.
- Fix the FMS unit test and the FMS example file `data/star-q3.fms`
- 3D electromagnetic proximity effect
- Implement AssemblePABoundary for VectorFEMassIntegrator HOT 2
- Suggested added feature: OptionsParser taking input from file
- HypreBoomerAMG preconditioner memory leaks HOT 6
- Error calling CUDA mfem::forall() with MFEM as a third party library HOT 3
- Maybe inconsistence of "domain_integes_marker" when construct a bilinearform with existed one
- Unit test "LOR AMS" failure with Umpire HOT 1
- parallel install error! HOT 8
- MFEM for helmoltz equation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mfem.