Skip to content

Complement ExtractDofsonBorder for vectorial finite element space#184

Open
zhaog6 wants to merge 1 commit into
FreeFem:developfrom
zhaog6:ExtractDofsonBorder
Open

Complement ExtractDofsonBorder for vectorial finite element space#184
zhaog6 wants to merge 1 commit into
FreeFem:developfrom
zhaog6:ExtractDofsonBorder

Conversation

@zhaog6

@zhaog6 zhaog6 commented Jul 6, 2021

Copy link
Copy Markdown
Contributor

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

@prj-

prj- commented Jul 6, 2021

Copy link
Copy Markdown
Member

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

zhaog6 commented Jul 6, 2021

Copy link
Copy Markdown
Contributor Author

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

zhaog6 commented Jul 6, 2021

Copy link
Copy Markdown
Contributor Author

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

@prj-

prj- commented Jul 6, 2021

Copy link
Copy Markdown
Member

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

@zhaog6

zhaog6 commented Jul 7, 2021

Copy link
Copy Markdown
Contributor Author

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