Skip to content

Commit f12e584

Browse files
authored
Merge pull request #1195 from sandialabs/bartgol/fo-thickness-omegah
Add omegah version of Humboldt thickness-coupled test
2 parents 698356c + 858e38f commit f12e584

12 files changed

Lines changed: 637 additions & 13 deletions

src/disc/extruded/Albany_ExtrudedDiscretization.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ checkForAdaptation (const Teuchos::RCP<const Thyra_Vector>& /* solution */,
150150
const Teuchos::RCP<const Thyra_Vector>& /* solution_dotdot */,
151151
const Teuchos::RCP<const Thyra_MultiVector>& /* dxdp */)
152152
{
153+
auto& adapt_params = m_disc_params->sublist("Mesh Adaptivity");
154+
auto adapt_type = adapt_params.get<std::string>("Type","None");
155+
auto adapt_data = Teuchos::rcp(new AdaptationData());
156+
if (adapt_type=="None") {
157+
return adapt_data;
158+
}
153159
// We can't just do
154160
// return m_basal_disc->checkForAdaptation(solution,solution_dot,solution_dotdot);
155161
// We need to decide WHAT to bass to basal disc: the whole solution or the projection?
@@ -698,6 +704,11 @@ ExtrudedDiscretization::computeSideSets()
698704
" - elem nodes gids: " + util::join(elem_nodes,",") + "\n");
699705
return pos;
700706
};
707+
// Track added side GIDs to avoid duplicates. This matters for "lateralside",
708+
// which is built from all basal side sets. If those side sets overlap (e.g.,
709+
// boundary_side_set contains boundary_side_set_1 and boundary_side_set_2),
710+
// iterating all of them would add the same 3D face multiple times.
711+
std::set<GO> added_side_GIDs;
701712
for (int ws=0; ws<m_basal_disc->getNumWorksets(); ++ws) {
702713
for (const auto& basal_ssn : basal_ss_names) {
703714
auto basal_ss = m_basal_disc->getSideSets(ws).at(basal_ssn);
@@ -709,6 +720,9 @@ ExtrudedDiscretization::computeSideSets()
709720
sStruct.elem_GID = layers_data.cell.gid->getId(basal_elem_gid,ilev);
710721
sStruct.side_GID = 2*num_glb_basal_elems + side_layers_gid.getId(basal_side.side_GID,ilev);
711722

723+
// Skip if this side was already added (can happen when basal side sets overlap)
724+
if (!added_side_GIDs.insert(sStruct.side_GID).second) continue;
725+
712726
auto elem_LID = cell_indexer->getLocalElement(sStruct.elem_GID);
713727
sStruct.ws_elem_idx = m_elem_ws_idx[elem_LID].idx;
714728
side_GIDs.push_back(sStruct.side_GID);

src/disc/omegah/Albany_OmegahDiscretization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ updateMesh ()
177177
switch (st->dim.size()) {
178178
case 2: numComps = 1; break;
179179
case 3: numComps = st->dim[2]; break;
180+
case 4: numComps = st->dim[2]*st->dim[3]; break;
180181
default:
181182
throw std::runtime_error(
182183
"[OmegahDiscretization::updateMesh] Error! Unsupported nodal state rank.\n"

src/disc/omegah/Albany_OmegahGenericMesh.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,12 @@ loadOmegahMesh ()
281281

282282
this->declare_part(pn, topo, is_in_part, mark_downward);
283283

284-
if (ent_dim==0) {
285-
nsNames.push_back(pn);
286-
} else if (ent_dim==m_mesh->dim()-1) {
284+
if (ent_dim>=m_mesh->dim()-1) {
287285
ssNames.push_back(pn);
286+
if (mark_downward)
287+
nsNames.push_back(pn);
288+
} else if (ent_dim==0) {
289+
nsNames.push_back(pn);
288290
}
289291
}
290292

tests/landIce/AsciiMeshes/Humboldt/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/A_notLumped_humboldt.mm
5050
${CMAKE_CURRENT_BINARY_DIR}/A_notLumped_humboldt.mm COPYONLY)
5151
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/D_notLumped_humboldt.mm
5252
${CMAKE_CURRENT_BINARY_DIR}/D_notLumped_humboldt.mm COPYONLY)
53+
54+
add_subdirectory(humboldt_contiguous_2d.osh)
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/0.osh
2+
${CMAKE_CURRENT_BINARY_DIR}/0.osh COPYONLY)
3+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nparts
4+
${CMAKE_CURRENT_BINARY_DIR}/nparts COPYONLY)
5+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version
6+
${CMAKE_CURRENT_BINARY_DIR}/version COPYONLY)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11

tests/landIce/FO_GIS/CMakeLists.txt

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ IF(NOT Kokkos_ENABLE_CUDA)
347347
#see issue #420.
348348
set (testName ${testNameRoot}_CoupledThickness)
349349
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input_fo_gis_coupled.yaml
350-
${CMAKE_CURRENT_BINARY_DIR}/input_fo_gis_coupled.yaml)
350+
${CMAKE_CURRENT_BINARY_DIR}/input_fo_gis_coupled.yaml)
351351

352352
add_test(${testName} ${Albany.exe} input_fo_gis_coupled.yaml)
353353
set_tests_properties(${testName} PROPERTIES LABELS "LandIce;Forward")
@@ -361,13 +361,37 @@ IF(NOT Kokkos_ENABLE_CUDA)
361361
set_tests_properties(${testName} PROPERTIES LABELS "LandIce;Forward" FIXTURES_REQUIRED humboldtMeshSetup)
362362

363363
else()
364-
set (testName ${testNameRoot}_Humboldt_Transient)
365-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input_fo_humboldt_transient.yaml
366-
${CMAKE_CURRENT_BINARY_DIR}/input_fo_humboldt_transient.yaml)
367-
add_test(${testName} ${Albany.exe} input_fo_humboldt_transient.yaml)
364+
set (testName ${testNameRoot}_Humboldt_Transient_STK3D)
365+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input_fo_humboldt_transient_stk3d.yaml
366+
${CMAKE_CURRENT_BINARY_DIR}/input_fo_humboldt_transient_stk3d.yaml)
367+
add_test(${testName} ${Albany.exe} input_fo_humboldt_transient_stk3d.yaml)
368+
set_tests_properties(${testName} PROPERTIES LABELS "LandIce;Forward" FIXTURES_REQUIRED humboldtMeshSetup)
369+
370+
set (testName ${testNameRoot}_Humboldt_Transient_STK)
371+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input_fo_humboldt_transient_stk.yaml
372+
${CMAKE_CURRENT_BINARY_DIR}/input_fo_humboldt_transient_stk.yaml)
373+
add_test(${testName} ${Albany.exe} input_fo_humboldt_transient_stk.yaml)
368374
set_tests_properties(${testName} PROPERTIES LABELS "LandIce;Forward" FIXTURES_REQUIRED humboldtMeshSetup)
369-
endif()
370375

376+
if (ALBANY_OMEGAH)
377+
# TODO: when exo2osh treats nodesets correctly, we can uncomment this (and remove code in AsciiMeshes/Humboldt)
378+
# set (testName ${testNameRoot}_Humboldt_Transient_Omega_h)
379+
# add_test (NAME ${testName}_CreateHumboldtOsh
380+
# COMMAND ${OMEGAH_EXO2OSH} humboldt_contiguous_2d.exo humboldt_contiguous_2d.osh
381+
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../AsciiMeshes/Humboldt)
382+
# set_tests_properties (${testName}_CreateHumboldtOsh PROPERTIES
383+
# LABELS "LandIce;Forward;Omega_h"
384+
# FIXTURES_SETUP CreateHumboldtOshMesh)
385+
386+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input_fo_humboldt_transient_omegah.yaml
387+
${CMAKE_CURRENT_BINARY_DIR}/input_fo_humboldt_transient_omegah.yaml)
388+
add_test(${testName} ${Albany.exe} input_fo_humboldt_transient_omegah.yaml)
389+
set_tests_properties(${testName} PROPERTIES
390+
LABELS "LandIce;Forward;Omega_h")
391+
# set_tests_properties(${testName} PROPERTIES
392+
# FIXTURES_REQUIRED CreateHumboldtOshMesh)
393+
endif()
394+
endif()
371395
endif()
372396

373397
####################################

0 commit comments

Comments
 (0)