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

Complement ExtractDofsonBorder for vectorial finite element space #184

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

zhaog6
Copy link
Contributor

@zhaog6 zhaog6 commented Jul 6, 2021

The PR supports extracting DOFs from border for vectorial finite element space.

@prj-
Copy link
Member

prj- commented Jul 6, 2021

I'm not really sure that this is needed. You could just get the border with a P_1 finite element space and then multiply and shift to get a "multi-component" border.

@zhaog6
Copy link
Contributor Author

zhaog6 commented Jul 6, 2021

I'm not really sure that this is needed. You could just get the border with a P_1 finite element space and then multiply and shift to get a "multi-component" border.

You are right. I ignored the shortcut.

@zhaog6
Copy link
Contributor Author

zhaog6 commented Jul 6, 2021

But for [P2, P2, P1], this seems to be more complicated, Could I do it following your suggestion in the case?

@prj-
Copy link
Member

prj- commented Jul 6, 2021

It won't be as easy for [P2, P2, P1], but your code won't work either for such a fespace, I guess.

@zhaog6
Copy link
Contributor Author

zhaog6 commented Jul 7, 2021

I try it, from the result of plot, it looks like ok when I run the following code, and the number of DOFs on the border seems ok.

include "ExtractDofsonBorder.idp"

macro fe() [P2, P2, P1] //

mesh Th = square(64, 64);
int[int] labs = 1 : 3;
int[int] doflabs;
fespace Vh(Th, fe);
ExtractDofsonBorder(labs, Vh, doflabs, 1, 3);
Vh [uh, vh, ph] = [0, 0, 0];
for (int j = 0; j < doflabs.n; ++j) {
    uh[][doflabs[j]] = 1;
}
plot(uh, cmm="uh", wait=1);
plot(vh, cmm="vh", wait=1);
plot(ph, cmm="ph", wait=1);

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

Successfully merging this pull request may close these issues.

2 participants