<div dir="ltr"><div dir="ltr">On Wed, Apr 5, 2023 at 11:23 AM neil liu <<a href="mailto:liufield@gmail.com">liufield@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks a lot, Matt. I indeed did some research using Hcurl Nedelec element to solve 3D maxwell equations. I didn't consider too much math related to Nedelec element (P and P minus). That is why I would like some references from you. <div><br></div><div>Could you please direct me the source code defining the Hdiv basis functions? </div></div></blockquote><div><br></div><div>This is what I use for RT1-P0 on quadrilaterals, with fields names "phi" and "q",<br><br> # RT1-P0 on quads<br> testset:<br> args: -dm_plex_simplex 0 -dm_plex_box_bd periodic,none -dm_plex_box_faces 3,1 \<br> -dm_plex_box_lower 0,-1 -dm_plex_box_upper 6.283185307179586,1\<br> -phi_petscspace_degree 0 \<br> -phi_petscdualspace_lagrange_use_moments \<br> -phi_petscdualspace_lagrange_moment_order 2 \<br> -q_petscfe_default_quadrature_order 1 \<br> -q_petscspace_type sum \<br> -q_petscspace_variables 2 \<br> -q_petscspace_components 2 \<br> -q_petscspace_sum_spaces 2 \<br> -q_petscspace_sum_concatenate true \<br> -q_sumcomp_0_petscspace_variables 2 \<br> -q_sumcomp_0_petscspace_type tensor \<br> -q_sumcomp_0_petscspace_tensor_spaces 2 \<br> -q_sumcomp_0_petscspace_tensor_uniform false \<br> -q_sumcomp_0_tensorcomp_0_petscspace_degree 1 \<br> -q_sumcomp_0_tensorcomp_1_petscspace_degree 0 \<br> -q_sumcomp_1_petscspace_variables 2 \<br> -q_sumcomp_1_petscspace_type tensor \<br> -q_sumcomp_1_petscspace_tensor_spaces 2 \<br> -q_sumcomp_1_petscspace_tensor_uniform false \<br> -q_sumcomp_1_tensorcomp_0_petscspace_degree 0 \<br> -q_sumcomp_1_tensorcomp_1_petscspace_degree 1 \<br> -q_petscdualspace_form_degree -1 \<br> -q_petscdualspace_order 1 \<br> -q_petscdualspace_lagrange_trimmed true \<br></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 5, 2023 at 11:16 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, Apr 5, 2023 at 10:36 AM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks, Matt. <div>When you said "P and P minus space" , do you have some references about this terminology to build the Hdiv and Hcurl for triangles or tetrahedra? </div></div></blockquote><div><br></div><div>The canonical reference is <a href="https://www-users.cse.umn.edu/~arnold//papers/acta.pdf" target="_blank">https://www-users.cse.umn.edu/~arnold//papers/acta.pdf</a> but that was hard to understand for me. There must</div><div>be a better reference but I do not know it.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 5, 2023 at 10:12 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, Apr 5, 2023 at 10:00 AM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thanks, Matt.</div><div>1) You mentioned that "PETSc calculates u_x, given the PetscFE and the coefficients (and the geometry).".</div><div>Could you please direct me the source code that calculates u_x ?</div></div></blockquote><div><br></div><div><a href="https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/fe/interface/fe.c#L2124" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/fe/interface/fe.c#L2124</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>2) Yes. Raviart-Thomas is one type of Nedelec element (Hdiv also called divergence conforming). Do you support Hcurl (curl conforming) Nedelec element ? </div></div></blockquote><div><br></div><div>Yes, you make them in the same way using the P and P^- spaces.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 4, 2023 at 10:59 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Apr 4, 2023 at 10:45 AM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I am learning this case, <a href="https://petsc.org/release/src/snes/tutorials/ex62.c.html" target="_blank">https://petsc.org/release/src/snes/tutorials/ex62.c.html</a></div><div>. And try to make myself familiar with the FEM (PetscFE) there. </div><div>Then I have several questions. </div><div>1) <a href="https://petsc.org/release/manualpages/DT/PetscDSSetResidual/" target="_blank">PetscDSSetResidual</a>, </div><div>For example, line <a name="m_-5071801941080072706_m_-6398916805396612546_m_9075578098109543337_m_-6876525254499075164_m_-514658911637031619_m_8640405558964829999_m_585389396370613898_line291" style="color:rgb(0,0,0)">291, </a><span style="color:rgb(0,0,0)"> </span><a href="https://petsc.org/release/manualpages/Sys/PetscCall/" target="_blank">PetscCall</a><span style="color:rgb(0,0,0)">(</span><a href="https://petsc.org/release/manualpages/DT/PetscDSSetResidual/" target="_blank">PetscDSSetResidual</a><span style="color:rgb(0,0,0)">(ds, 0, f0_quadratic_u, f1_u)), here, </span><span style="color:rgb(0,0,0)">f0_quadratic_u and </span><span style="color:rgb(0,0,0)">f1_u is function pointers. Where have the input parameter for these functions been calculated, e.g., u_x. </span></div></div></blockquote><div><br></div><div>Line 291 sets callback functions. These functions are actually called in the loop over the mesh which calculates the residual.</div><div>PETSc calculates u_x, given the PetscFE and the coefficients (and the geometry).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0)">If I want to check the values of these parameters before line 291, how to print that ?</span></div></div></blockquote><div><br></div><div>I output many thing with -dm_plex_print_fem 5, but I am not sure if I print out the field jet. It would be easy to add.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0)">2) Does PetscFE support Nedelec element? Will it be painful to add these modules myself ?</span></div></div></blockquote><div><br></div><div>What kind? I think we support them, but have no tests. Take a look at our support for Raviart-Thomas</div><div><br></div><div> <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/dualspace/impls/lagrange/tutorials/ex1.c#L78" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/dualspace/impls/lagrange/tutorials/ex1.c#L78</a></div><div><br></div><div>and see a use case here</div><div><br></div><div> <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex24.c" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex24.c</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0)">Thanks ,</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Xiaodong </span></div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>