Hi there,
We want to construct a 3D triangulation by extruding a 2D triangulation (one that potentially contains hanging nodes) and we only want one slice/layer of mesh on the extrusion direction.
Looking around in the GridGenerator namespace led me to the extrude_triangulation function. It’s doing everything we desire except for that (a) the slices/layers on the extrusion direction has to be at least two and (b) the 2D mesh must be a coarse mesh. I’m wondering if there are tips on getting around these two restrictions.
Originally I was using GridGenerator::hyper_rectangle teamed with anisotropic refinement cut_xy. But this ceases to work after the code was re-implemented with parallel::distributed::Triangulation because “this class does not support anisotropic refinement, because it relies on the p4est library that does not support this” [1].
Thanks a lot in advance for any insights and suggestions!
Best,
Greg
[1]
https://www.dealii.org/current/doxygen/deal.II/classparallel_1_1distributed_1_1Triangulation.html
Hi Wolfgang,
Thanks a lot for clarifying!
I decided to modify the code to adopt a p::shared::T model with METIS and
realized anisotropic refinement doesn’t seem to work for this case either. The
error comes from AffineConstraints’ unacceptance of any refinement cases that
are not isotropic. The same error can be reproduced for my serial code as well.
If I change the RefinementCase, when it’s, say, cut_yz, to cut_xyz, hence going
back to isotropic refinement, both codes run without a problem.
My code is implementing a space-time IP-HDG method. It would be nice to have
anisotropic refinements in order to separate local time stepping and spatial
refinement within a space-time slab. Here is the part of the code where
AffineConstraints gets involved and it’s pretty much copied verbatim from step-51:
And here is the runtime error message:
An error occurred in line <1102> of file <path/to/deal.II/9.4.1-petsc-hypre/source/source/dofs/dof_tools_constraints.cc> in function
void dealii::DoFTools::internal::make_hp_hanging_node_constraints(const dealii::DoFHandler&, dealii::AffineConstraints&) [with int dim = 3; int spacedim = 3; number = double]
The violated condition was:
cell->face(face)->refinement_case() == RefinementCase::isotropic_refinement
Additional information:
You are trying to use functionality in deal.II that is currently not
implemented. In many cases, this indicates that there simply didn’t
appear much of a need for it, or that the author of the original code
did not have the time to implement a particular case. If you hit this
exception, it is therefore worth the time to look into the code to
find out whether you may be able to implement the missing
functionality. If you do, please consider providing a patch to the
deal.II development sources (see the deal.II website on how to
contribute).
I’m wondering if it would be ill-advised to simply remove the assertion and
re-compile the library. If so, I’m thinking about going a bit deeper and see if
I can come up with a patch. In that case, I would really appreciate some
insights in terms of AffineConstraints’ incompatibilities, if any, with hanging
nodes created by anisotropic refinement.
Thanks,
Greg
Hi Wolfgang,
Thanks a lot for your suggestions! My code is actually not using hp but simply
FE_DGQ<3>(1) and FE_FaceQ<3>(1). The related source code shows that the
boolean of dof_handler.get_fe_collection().hp_constraints_are_implemented()
decides whether internal::make_hp_hanging_node_constraints(dof_handler,
constraints) should be called and for the FE_FaceQ class,
make_hp_hanging_node_constraints
always
returns true. This makes sense since the 2D implementation of
make_oldstyle_hanging_node_constraints seems to be looping over cells and
their 1D faces to locate hanging nodes, which won’t apply to FE_FaceQ<3>(1).
As a reference, I wrote a stripped-down version applying IPHDG to step-4’s
Poisson problem and reproduced the same error message. Demo-wise, four cases
were ran with attached pngs numbered accordingly:
Would you consider as a way out of this rewriting the 2D version of
make_oldstyle_hanging_node_constraints by essentially replacing the cell/face
pairs with face/line pairs?
Best regards,
Greg
Hi Wolfgang,
Or is it true that these days anisotropic refinement only works
for DG elements where constraints are not an issue?
I grepped anisotropic refinement related funtion names from
tutorial programs and only found step-30. Indeed as you observed,
it’s a DG finite element with L2 conformity, hence sparing
AffineConstraint. It appears get_dpo_vector is implemented
relatively
trivially
for these FEs such that n_dofs_per_face would return 0. The
make_hp_hanging_node_constraints function would have therefore
ignored
them anyways.
No, the old-style way just needs to go. What is missing is that
the hp function needs to learn how to do anisotropic
refinement.
After going through the hp-paper and the
make_hp_hanging_node_constraints function, it seems that, at
least for my current purposes, a lot of code won’t be triggered
since my dofhandlers are not hp capable and hence all affine
constraints fall under the simple case in the hp paper. Though
I’m not sure how susceptible the simple case code would be to the
complications anisotropic refinement brings in step-30. I’ll
spend more time looking into it.
Best regards,
Greg