Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the value at one dof #35

Closed
Watchmojo opened this issue Jan 31, 2016 · 4 comments
Closed

Fix the value at one dof #35

Watchmojo opened this issue Jan 31, 2016 · 4 comments
Assignees

Comments

@Watchmojo
Copy link

Hi,

I am trying to solve \Delta u=1, with u=0 imposed at one point. This is commonly used in CFD for the Poisson equation of pressure.

I modified "periodic-cube.mesh" to make it only periodic in x and y directions. I want to fix the first dof in process 0 to 0.0. Here is how I tried to do this:

Array pdofs(1); Vector pfix(1);
pdofs=0; pfix=0.0;
if(myid==0) a->EliminateVDofs( pdofs, pfix,*b);

Here is the result.
snapshot4

Could you please explain to me where I did wrong?

Thank you very much,
Frank

@Watchmojo
Copy link
Author

Here is my mesh file.

MFEM mesh v1.0

MFEM Geometry Types (see mesh/geom.hpp):

POINT = 0

SEGMENT = 1

TRIANGLE = 2

SQUARE = 3

TETRAHEDRON = 4

CUBE = 5

dimension
3

format: <vertex 0> <vertex 1> ...

elements
27
1 5 0 1 4 3 9 10 13 12
1 5 1 2 5 4 10 11 14 13
1 5 2 0 3 5 11 9 12 14
1 5 3 4 7 6 12 13 16 15
1 5 4 5 8 7 13 14 17 16
1 5 5 3 6 8 14 12 15 17
1 5 6 7 1 0 15 16 10 9
1 5 7 8 2 1 16 17 11 10
1 5 8 6 0 2 17 15 9 11
1 5 9 10 13 12 18 19 22 21
1 5 10 11 14 13 19 20 23 22
1 5 11 9 12 14 20 18 21 23
1 5 12 13 16 15 21 22 25 24
1 5 13 14 17 16 22 23 26 25
1 5 14 12 15 17 23 21 24 26
1 5 15 16 10 9 24 25 19 18
1 5 16 17 11 10 25 26 20 19
1 5 17 15 9 11 26 24 18 20
1 5 18 19 22 21 27 28 31 30
1 5 19 20 23 22 28 29 32 31
1 5 20 18 21 23 29 27 30 32
1 5 21 22 25 24 30 31 34 33
1 5 22 23 26 25 31 32 35 34
1 5 23 21 24 26 32 30 33 35
1 5 24 25 19 18 33 34 28 27
1 5 25 26 20 19 34 35 29 28
1 5 26 24 18 20 35 33 27 29

boundary
54
1 3 0 1 4 3
1 3 1 2 5 4
1 3 2 0 3 5
1 3 3 4 7 6
1 3 4 5 8 7
1 3 5 3 6 8
1 3 6 7 1 0
1 3 7 8 2 1
1 3 8 6 0 2
6 3 27 28 31 30
6 3 28 29 32 31
6 3 29 27 30 32
6 3 30 31 34 33
6 3 31 32 35 34
6 3 32 30 33 35
6 3 33 34 28 27
6 3 34 35 29 28
6 3 35 33 27 29
2 3 0 3 12 9
2 3 3 6 15 12
2 3 6 0 9 15
2 3 9 12 21 18
2 3 12 15 24 21
2 3 15 9 18 24
2 3 18 21 30 27
2 3 21 24 33 30
2 3 24 18 27 33
5 3 12 3 0 9
5 3 15 6 3 12
5 3 9 0 6 15
5 3 21 12 9 18
5 3 24 15 12 21
5 3 18 9 15 24
5 3 30 21 18 27
5 3 33 24 21 30
5 3 27 18 24 33
3 3 0 1 10 9
3 3 1 2 11 10
3 3 2 0 9 11
3 3 9 10 19 18
3 3 10 11 20 19
3 3 11 9 18 20
3 3 18 19 28 27
3 3 19 20 29 28
3 3 20 18 27 29
4 3 10 1 0 9
4 3 11 2 1 10
4 3 9 0 2 11
4 3 19 10 9 18
4 3 20 11 10 19
4 3 18 9 11 20
4 3 28 19 18 27
4 3 29 20 19 28
4 3 27 18 20 29

vertices
36

nodes
FiniteElementSpace
FiniteElementCollection: L2_T1_3D_P1
VDim: 3
Ordering: 1

-1.000000 -1.000000 -1.000000
-0.333333 -1.000000 -1.000000
-1.000000 -0.333333 -1.000000
-0.333333 -0.333333 -1.000000
-1.000000 -1.000000 -0.333333
-0.333333 -1.000000 -0.333333
-1.000000 -0.333333 -0.333333
-0.333333 -0.333333 -0.333333

-0.333333 -1.000000 -1.000000
0.333333 -1.000000 -1.000000
-0.333333 -0.333333 -1.000000
0.333333 -0.333333 -1.000000
-0.333333 -1.000000 -0.333333
0.333333 -1.000000 -0.333333
-0.333333 -0.333333 -0.333333
0.333333 -0.333333 -0.333333

0.333333 -1.000000 -1.000000
1.000000 -1.000000 -1.000000
0.333333 -0.333333 -1.000000
1.000000 -0.333333 -1.000000
0.333333 -1.000000 -0.333333
1.000000 -1.000000 -0.333333
0.333333 -0.333333 -0.333333
1.000000 -0.333333 -0.333333

-1.000000 -0.333333 -1.000000
-0.333333 -0.333333 -1.000000
-1.000000 0.333333 -1.000000
-0.333333 0.333333 -1.000000
-1.000000 -0.333333 -0.333333
-0.333333 -0.333333 -0.333333
-1.000000 0.333333 -0.333333
-0.333333 0.333333 -0.333333

-0.333333 -0.333333 -1.000000
0.333333 -0.333333 -1.000000
-0.333333 0.333333 -1.000000
0.333333 0.333333 -1.000000
-0.333333 -0.333333 -0.333333
0.333333 -0.333333 -0.333333
-0.333333 0.333333 -0.333333
0.333333 0.333333 -0.333333

0.333333 -0.333333 -1.000000
1.000000 -0.333333 -1.000000
0.333333 0.333333 -1.000000
1.000000 0.333333 -1.000000
0.333333 -0.333333 -0.333333
1.000000 -0.333333 -0.333333
0.333333 0.333333 -0.333333
1.000000 0.333333 -0.333333

-1.000000 0.333333 -1.000000
-0.333333 0.333333 -1.000000
-1.000000 1.000000 -1.000000
-0.333333 1.000000 -1.000000
-1.000000 0.333333 -0.333333
-0.333333 0.333333 -0.333333
-1.000000 1.000000 -0.333333
-0.333333 1.000000 -0.333333

-0.333333 0.333333 -1.000000
0.333333 0.333333 -1.000000
-0.333333 1.000000 -1.000000
0.333333 1.000000 -1.000000
-0.333333 0.333333 -0.333333
0.333333 0.333333 -0.333333
-0.333333 1.000000 -0.333333
0.333333 1.000000 -0.333333

0.333333 0.333333 -1.000000
1.000000 0.333333 -1.000000
0.333333 1.000000 -1.000000
1.000000 1.000000 -1.000000
0.333333 0.333333 -0.333333
1.000000 0.333333 -0.333333
0.333333 1.000000 -0.333333
1.000000 1.000000 -0.333333

-1.000000 -1.000000 -0.333333
-0.333333 -1.000000 -0.333333
-1.000000 -0.333333 -0.333333
-0.333333 -0.333333 -0.333333
-1.000000 -1.000000 0.333333
-0.333333 -1.000000 0.333333
-1.000000 -0.333333 0.333333
-0.333333 -0.333333 0.333333

-0.333333 -1.000000 -0.333333
0.333333 -1.000000 -0.333333
-0.333333 -0.333333 -0.333333
0.333333 -0.333333 -0.333333
-0.333333 -1.000000 0.333333
0.333333 -1.000000 0.333333
-0.333333 -0.333333 0.333333
0.333333 -0.333333 0.333333

0.333333 -1.000000 -0.333333
1.000000 -1.000000 -0.333333
0.333333 -0.333333 -0.333333
1.000000 -0.333333 -0.333333
0.333333 -1.000000 0.333333
1.000000 -1.000000 0.333333
0.333333 -0.333333 0.333333
1.000000 -0.333333 0.333333

-1.000000 -0.333333 -0.333333
-0.333333 -0.333333 -0.333333
-1.000000 0.333333 -0.333333
-0.333333 0.333333 -0.333333
-1.000000 -0.333333 0.333333
-0.333333 -0.333333 0.333333
-1.000000 0.333333 0.333333
-0.333333 0.333333 0.333333

-0.333333 -0.333333 -0.333333
0.333333 -0.333333 -0.333333
-0.333333 0.333333 -0.333333
0.333333 0.333333 -0.333333
-0.333333 -0.333333 0.333333
0.333333 -0.333333 0.333333
-0.333333 0.333333 0.333333
0.333333 0.333333 0.333333

0.333333 -0.333333 -0.333333
1.000000 -0.333333 -0.333333
0.333333 0.333333 -0.333333
1.000000 0.333333 -0.333333
0.333333 -0.333333 0.333333
1.000000 -0.333333 0.333333
0.333333 0.333333 0.333333
1.000000 0.333333 0.333333

-1.000000 0.333333 -0.333333
-0.333333 0.333333 -0.333333
-1.000000 1.000000 -0.333333
-0.333333 1.000000 -0.333333
-1.000000 0.333333 0.333333
-0.333333 0.333333 0.333333
-1.000000 1.000000 0.333333
-0.333333 1.000000 0.333333

-0.333333 0.333333 -0.333333
0.333333 0.333333 -0.333333
-0.333333 1.000000 -0.333333
0.333333 1.000000 -0.333333
-0.333333 0.333333 0.333333
0.333333 0.333333 0.333333
-0.333333 1.000000 0.333333
0.333333 1.000000 0.333333

0.333333 0.333333 -0.333333
1.000000 0.333333 -0.333333
0.333333 1.000000 -0.333333
1.000000 1.000000 -0.333333
0.333333 0.333333 0.333333
1.000000 0.333333 0.333333
0.333333 1.000000 0.333333
1.000000 1.000000 0.333333

-1.000000 -1.000000 0.333333
-0.333333 -1.000000 0.333333
-1.000000 -0.333333 0.333333
-0.333333 -0.333333 0.333333
-1.000000 -1.000000 1.000000
-0.333333 -1.000000 1.000000
-1.000000 -0.333333 1.000000
-0.333333 -0.333333 1.000000

-0.333333 -1.000000 0.333333
0.333333 -1.000000 0.333333
-0.333333 -0.333333 0.333333
0.333333 -0.333333 0.333333
-0.333333 -1.000000 1.000000
0.333333 -1.000000 1.000000
-0.333333 -0.333333 1.000000
0.333333 -0.333333 1.000000

0.333333 -1.000000 0.333333
1.000000 -1.000000 0.333333
0.333333 -0.333333 0.333333
1.000000 -0.333333 0.333333
0.333333 -1.000000 1.000000
1.000000 -1.000000 1.000000
0.333333 -0.333333 1.000000
1.000000 -0.333333 1.000000

-1.000000 -0.333333 0.333333
-0.333333 -0.333333 0.333333
-1.000000 0.333333 0.333333
-0.333333 0.333333 0.333333
-1.000000 -0.333333 1.000000
-0.333333 -0.333333 1.000000
-1.000000 0.333333 1.000000
-0.333333 0.333333 1.000000

-0.333333 -0.333333 0.333333
0.333333 -0.333333 0.333333
-0.333333 0.333333 0.333333
0.333333 0.333333 0.333333
-0.333333 -0.333333 1.000000
0.333333 -0.333333 1.000000
-0.333333 0.333333 1.000000
0.333333 0.333333 1.000000

0.333333 -0.333333 0.333333
1.000000 -0.333333 0.333333
0.333333 0.333333 0.333333
1.000000 0.333333 0.333333
0.333333 -0.333333 1.000000
1.000000 -0.333333 1.000000
0.333333 0.333333 1.000000
1.000000 0.333333 1.000000

-1.000000 0.333333 0.333333
-0.333333 0.333333 0.333333
-1.000000 1.000000 0.333333
-0.333333 1.000000 0.333333
-1.000000 0.333333 1.000000
-0.333333 0.333333 1.000000
-1.000000 1.000000 1.000000
-0.333333 1.000000 1.000000

-0.333333 0.333333 0.333333
0.333333 0.333333 0.333333
-0.333333 1.000000 0.333333
0.333333 1.000000 0.333333
-0.333333 0.333333 1.000000
0.333333 0.333333 1.000000
-0.333333 1.000000 1.000000
0.333333 1.000000 1.000000

0.333333 0.333333 0.333333
1.000000 0.333333 0.333333
0.333333 1.000000 0.333333
1.000000 1.000000 0.333333
0.333333 0.333333 1.000000
1.000000 0.333333 1.000000
0.333333 1.000000 1.000000
1.000000 1.000000 1.000000

@Watchmojo
Copy link
Author

I solved this problem now. Thank you :)

@tzanio
Copy link
Member

tzanio commented Jan 31, 2016

Hi Frank,

I'm glad to hear you got it working. Do you want to share the solution so we can refer to it in the future?

Cheers,
Tzanio

@Watchmojo
Copy link
Author

Hi, Tzanio,

I used the following code to eliminate 1 dof, which increases the rank of discritized Laplace by one.

Array pdofs(1); Vector pfix(1);
pdofs=0; pfix=0.0;
if(myid==0) a->EliminateVDofs( pdofs, pfix,*b);

I should not test this with -\Delta u=1 for periodic plane channel, as the analytic solution does not exist. I am constructing other cases to test this.

Thank you,
Frank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants