Skip to content

Commit

Permalink
Merge pull request mfem#3857 from mfem/fix-connect-boundaries3d
Browse files Browse the repository at this point in the history
Fix check in NURBSExtension::ConnectBoundaries3D [fix-connect-boundaries3d]
  • Loading branch information
tzanio authored Sep 19, 2023
2 parents 8a9ca13 + c5f703a commit d063a4a
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesh/nurbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ void NURBSExtension::ConnectBoundaries3D(int bnd0, int bnd1)
if (p2g0.ny() != p2g1.ny()) { compatible = false; }

if (kv0[0]->GetNKS() != kv1[0]->GetNKS()) { compatible = false; }
if (kv0[1]->GetNKS() != kv1[0]->GetNKS()) { compatible = false; }
if (kv0[1]->GetNKS() != kv1[1]->GetNKS()) { compatible = false; }

if (kv0[0]->GetOrder() != kv1[0]->GetOrder()) { compatible = false; }
if (kv0[1]->GetOrder() != kv1[1]->GetOrder()) { compatible = false; }
Expand All @@ -2157,7 +2157,7 @@ void NURBSExtension::ConnectBoundaries3D(int bnd0, int bnd1)
mfem::out<<p2g0.ny()<<" "<<p2g1.ny()<<endl;

mfem::out<<kv0[0]->GetNKS()<<" "<<kv1[0]->GetNKS()<<endl;
mfem::out<<kv0[1]->GetNKS()<<" "<<kv1[0]->GetNKS()<<endl;
mfem::out<<kv0[1]->GetNKS()<<" "<<kv1[1]->GetNKS()<<endl;

mfem::out<<kv0[0]->GetOrder()<<" "<<kv1[0]->GetOrder()<<endl;
mfem::out<<kv0[1]->GetOrder()<<" "<<kv1[1]->GetOrder()<<endl;
Expand Down
4 changes: 4 additions & 0 deletions miniapps/nurbs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ if (MFEM_ENABLE_TESTING)
add_test(NAME nurbs_ex1_two_cubes_autoedge_knot_insert
COMMAND $<TARGET_FILE:nurbs_ex1> -no-vis
-m ${PROJECT_SOURCE_DIR}/miniapps/nurbs/meshes/two-cubes-nurbs-autoedge.mesh -o 1 -r 3 -rf ${PROJECT_SOURCE_DIR}/miniapps/nurbs/meshes/two-cubes.ref)

add_test(NAME nurbs_ex1_periodic_3d
COMMAND $<TARGET_FILE:nurbs_ex1> -no-vis
-m ${PROJECT_SOURCE_DIR}/miniapps/nurbs/meshes/cube-nurbs.mesh -pm "1" -ps "2" -rf ${PROJECT_SOURCE_DIR}/miniapps/nurbs/meshes/cube.ref)
endif()

if (MFEM_USE_MPI)
Expand Down
2 changes: 2 additions & 0 deletions miniapps/nurbs/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ EX1_ARGS_14 := -m $(MFEM_DIR)/miniapps/nurbs/meshes/two-squares-nurbs-autoedge.m
EX1_ARGS_15 := -m $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes-nurbs.mesh -o 1 -r 3 -rf $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes.ref
EX1_ARGS_16 := -m $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes-nurbs-rot.mesh -o 1 -r 3 -rf $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes.ref
EX1_ARGS_17 := -m $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes-nurbs-autoedge.mesh -o 1 -r 3 -rf $(MFEM_DIR)/miniapps/nurbs/meshes/two-cubes.ref
EX1_ARGS_18 := -m $(MFEM_DIR)/miniapps/nurbs/meshes/cube-nurbs.mesh -pm "1" -ps "2" -rf $(MFEM_DIR)/miniapps/nurbs/meshes/cube.ref

nurbs_ex1-test-seq: nurbs_ex1
@$(call mfem-test,$<,, NURBS miniapp)
Expand All @@ -89,6 +90,7 @@ nurbs_ex1-test-seq: nurbs_ex1
@$(call mfem-test,$<,, NURBS miniapp,$(EX1_ARGS_15))
@$(call mfem-test,$<,, NURBS miniapp,$(EX1_ARGS_16))
@$(call mfem-test,$<,, NURBS miniapp,$(EX1_ARGS_17))
@$(call mfem-test,$<,, NURBS miniapp,$(EX1_ARGS_18))

EX1PATCH_ARGS_1 := -incdeg 3 -ref 2 -iro 8 -patcha
EX1PATCH_ARGS_2 := -incdeg 3 -ref 2 -iro 8 -patcha -pa
Expand Down
73 changes: 73 additions & 0 deletions miniapps/nurbs/meshes/cube-nurbs.mesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
MFEM NURBS mesh v1.0

#
# MFEM Geometry Types (see mesh/geom.hpp):
#
# SEGMENT = 1
# SQUARE = 3
# CUBE = 5
#

dimension
3

elements
1
1 5 0 1 2 3 4 5 6 7

boundary
6
1 3 3 2 1 0
2 3 4 5 6 7
3 3 0 1 5 4
4 3 1 2 6 5
5 3 2 3 7 6
6 3 3 0 4 7

edges
12
0 0 1
0 3 2
0 4 5
0 7 6
1 0 3
1 1 2
1 4 7
1 5 6
2 0 4
2 1 5
2 2 6
2 3 7

vertices
8

knotvectors
3
1 2 0 0 1 1
1 2 0 0 1 1
1 2 0 0 1 1

weights
1
1
1
1
1
1
1
1

FiniteElementSpace
FiniteElementCollection: NURBS1
VDim: 3
Ordering: 1

0 0 0
1 0 0
1 1 0
0 1 0
0 0 1
1 0 1
1 1 1
0 1 1
4 changes: 4 additions & 0 deletions miniapps/nurbs/meshes/cube.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3
2 0.2 0.5
1 0.5
1 0.5

0 comments on commit d063a4a

Please sign in to comment.