Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a76520f
starting refactor of ref_elem to support 1D, 2D, and 3D ref spaces
Jul 2, 2026
8512518
WIP: cleaned up unstructured mesh, overwrote ref_elem, and fixed bugs…
Jul 2, 2026
7ea0c1a
WIP: fixed bug and cleaned up ref_elem coding
Jul 2, 2026
fd5d7c5
WIP: added files for tests of ref elem
Jul 2, 2026
5f22c93
WIP: fixed cmake build of ref elem tests
Jul 2, 2026
02dfa94
WIP: partition of unity test passes 1D
Jul 2, 2026
adc2842
partion_unity_test is 1D,2D,3D, plus checking a large range of orders
Jul 2, 2026
c5c4984
updated test to use 20 quadrature points
Jul 2, 2026
a7ca4f1
partion of unity and gradient tests now include Legendre DOFs for the…
Jul 2, 2026
1013c9c
added more combinations of DG and FE spaces
Jul 2, 2026
7691d28
added collocated quadrature element test
Jul 6, 2026
f86fb45
interpolation test partially added
Jul 6, 2026
ca58af9
WIP interpolation tests
Jul 6, 2026
1bd4a46
interpolation checks for all combinations of Quad and RefElem
Jul 6, 2026
168ab0c
added gradient test and verified coding
Jul 6, 2026
9e3c78c
fixed gradient test problem
Jul 6, 2026
b35e34e
Coding passes full suite of integration tests
Jul 6, 2026
86f39db
minor cleaning up of coding
Jul 6, 2026
1888174
added integration test file and mesh test
Jul 7, 2026
570220a
Added Jacobian matrix
Jul 10, 2026
b661b61
fixed header in geometry.h
Jul 10, 2026
8b9f497
updated matar submodule
Jul 10, 2026
fe46729
Merge branch 'main' into ref_surf
Jul 10, 2026
e041cce
called jacobian function for mesh elem
Jul 10, 2026
446bd8d
updated Jacobian routine and adding tests
Jul 13, 2026
a2828a7
adding Jacobian tests
Jul 13, 2026
f10a37c
added jacobian test
Jul 13, 2026
ff65478
added surf quadrature and ref surf
Jul 22, 2026
e953abc
created surf quad Jacobian tests
Jul 22, 2026
b8d64ed
WIP, refactoring unstructured mesh object for surfaces
Jul 29, 2026
c00ab2f
fixed patches_in_surf index bug and fixed mesh ref_mesh_test.cpp
Jul 29, 2026
6b94fe1
Surface pair test added and coding passes it
Jul 29, 2026
206769c
Surface pair test added and coding passes it
Jul 29, 2026
948c3a5
added more surface checks
Jul 29, 2026
696a1bb
fixed thread bug with test and fixed ref_elem surf quad bug
Jul 29, 2026
fecd865
added const to global vars in tests for compiling on GPUs
Jul 29, 2026
d9e0ff6
fixed GPU bugs
Aug 3, 2026
7a18c91
fixed GPU bug in ref_plus_mesh_test.cpp
Aug 3, 2026
e7a365b
Fixed GPU bug in test
Aug 3, 2026
1a1cf2c
fixed missing .host GPU bugs
Aug 3, 2026
50737c8
named arrays in surf connectivity
Aug 3, 2026
9a89650
added ref_flux_test.cpp
Aug 3, 2026
1038f1d
added ref surf normal and tests
Aug 4, 2026
eb9fe4d
added volume calc via quadrature to flux test
Aug 4, 2026
46f5aa2
added remap test
Aug 5, 2026
6656f61
updated remap for arbitrary-order tests
Aug 7, 2026
0f78590
updated output text
Aug 7, 2026
63b8aaf
added update_host to vars being written to vtu
Aug 7, 2026
b25f9ef
added graphics output at t=0
Aug 7, 2026
239cb22
updated comment
Aug 7, 2026
c2783a2
WIP: AO DG remap scheme
Aug 11, 2026
af9daa9
added rk time integration
Aug 11, 2026
7c9d48e
WIP: DG algorithm fixes
Aug 11, 2026
5ad4002
WIP: fixed bug in DG vol integral, added inv Jacobian
Aug 12, 2026
8d82c87
DG P1 on TG vortex works
Aug 12, 2026
25e4d92
DG P3 remap works
Aug 12, 2026
7d6dfad
moved build_quadrature_point_connectivty() to geometry.h
Aug 12, 2026
a6476e6
updated namespace and added qpt connectivity in geometry.h
Aug 13, 2026
65eb523
removed name spaces in average.cpp
Aug 13, 2026
6dd8a6a
removed NEW from ifndef in ref elem
Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "MATAR"]
path = matar
url = https://github.com/lanl/MATAR.git
branch = main
branch = main
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ add_subdirectory(average)
add_subdirectory(decomp_example)
add_subdirectory(point_connectivity)
add_subdirectory(mesh_form)
add_subdirectory(reference_element)
# add_subdirectory(other_example) # Future examples go here
18 changes: 9 additions & 9 deletions examples/average/include/mesh_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ inline int PointIndexFromIJK(int i, int j, int k, const int* order)
///
/////////////////////////////////////////////////////////////////////////////
void build_3d_box(
swage::Mesh& mesh,
swage::Mesh_t& mesh,
node_t& node,
double origin[3],
double length[3],
Expand Down Expand Up @@ -212,7 +212,7 @@ void build_3d_box(
node.coords.update_host();

// initialize elem variables
mesh.initialize_elems(num_elems, num_dim);
mesh.initialize_elems(num_elems);

// populate the point data structures
FOR_ALL(k, 0, num_elems_k,
Expand Down Expand Up @@ -268,7 +268,7 @@ void build_3d_box(
/// \param rank rank
///
/////////////////////////////////////////////////////////////////////////////
void write_vtk(swage::Mesh& mesh,
void write_vtk(swage::Mesh_t& mesh,
node_t& node,
int rank)
{
Expand Down Expand Up @@ -526,7 +526,7 @@ void build_3d_box(
/// \param comm MPI communicator
///
/////////////////////////////////////////////////////////////////////////////
void write_vtu(swage::Mesh& mesh,
void write_vtu(swage::Mesh_t& mesh,
node_t& node,
GaussPoint_t& gauss_point,
int rank,
Expand Down Expand Up @@ -843,7 +843,7 @@ void write_vtu(swage::Mesh& mesh,
/// \param Number of dimensions
///
/////////////////////////////////////////////////////////////////////////////
void read_vtk_mesh(swage::Mesh& mesh,
void read_vtk_mesh(swage::Mesh_t& mesh,
node_t& node,
int num_dims,
std::string mesh_file_)
Expand Down Expand Up @@ -942,7 +942,7 @@ void write_vtu(swage::Mesh& mesh,
printf("Number of elements read in %zu\n", num_elem);

// initialize elem variables
mesh.initialize_elems(num_elem, num_dims);
mesh.initialize_elems(num_elem);

found=true;
} // end if
Expand Down Expand Up @@ -1001,9 +1001,9 @@ void write_vtu(swage::Mesh& mesh,
mesh.nodes_in_elem.update_device();


// initialize corner variables
size_t num_corners = num_elem * num_nodes_in_elem;
mesh.initialize_corners(num_corners);
// initialize corner variables (it is set in the elems initialization)
//size_t num_corners = num_elem * num_nodes_in_elem;
//mesh.initialize_corners(num_corners);


// Build connectivity
Expand Down
6 changes: 5 additions & 1 deletion examples/average/src/average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "state.h"



int main(int argc, char** argv) {

MATAR_INITIALIZE(argc, argv);
{ // MATAR scope
std::cout<<"Hello, Average Example!"<<std::endl;


printf("\nAverage test finished.\n");

} // end MATAR scope
MATAR_FINALIZE();

return 0;
}
}
20 changes: 10 additions & 10 deletions examples/decomp_example/include/mesh_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int PointIndexFromIJK(int i, int j, int k, const int* order)
///
/////////////////////////////////////////////////////////////////////////////
void build_3d_box(
swage::Mesh& mesh,
swage::Mesh_t& mesh,
MPICArrayKokkos<double>& node_coords,
double origin[3],
double length[3],
Expand Down Expand Up @@ -243,11 +243,11 @@ void build_3d_box(
node_coords.update_host();

// initialize elem variables
if (Pn_order == 0){
mesh.initialize_elems(num_elems, num_dim);
if (Pn_order == 0){ // BUG: Pn_order=1 is needed for coding above to work correctly
Comment thread
jacob-moore22 marked this conversation as resolved.
mesh.initialize_elems(num_elems);
Pn_order = 1;
} else {
mesh.initialize_elems_Pn(num_elems, num_dim, Pn_order);
mesh.initialize_elems_Pn(num_elems, Pn_order, 2*Pn_order);
Comment thread
jacob-moore22 marked this conversation as resolved.
}

// populate the point data structures
Expand Down Expand Up @@ -321,7 +321,7 @@ void build_3d_box(
///
/////////////////////////////////////////////////////////////////////////////
void build_2d_polar(
swage::Mesh& mesh,
swage::Mesh_t& mesh,
MPICArrayKokkos<double>& node_coords,
double& inner_radius,
double& outer_radius,
Expand Down Expand Up @@ -398,7 +398,7 @@ void build_2d_polar(
node_coords.update_device();

// initialize elem variables
mesh.initialize_elems(num_elems, num_dim);
mesh.initialize_elems(num_elems);

// populate the elem center data structures
for (int j = 0; j < num_elems_j; j++) {
Expand Down Expand Up @@ -432,9 +432,9 @@ void build_2d_polar(
// update device side
mesh.nodes_in_elem.update_device();

// intialize corner variables
int num_corners = num_elems * mesh.num_nodes_in_elem;
mesh.initialize_corners(num_corners);
// intialize corner variables (this is initialized in initialize_elems)
//int num_corners = num_elems * mesh.num_nodes_in_elem;
//mesh.initialize_corners(num_corners);
// corner.initialize(num_corners, num_dim);

// Build connectivity
Expand All @@ -455,7 +455,7 @@ void build_2d_polar(
/// \param comm MPI communicator
///
/////////////////////////////////////////////////////////////////////////////
void write_vtu(swage::Mesh& mesh,
void write_vtu(swage::Mesh_t& mesh,
node_t& node,
GaussPoint_t& gauss_point,
int rank,
Expand Down
6 changes: 4 additions & 2 deletions examples/decomp_example/src/mesh_decomp_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ int main(int argc, char** argv) {
int num_elems_j = 40;

// Initial mesh built on rank zero
swage::Mesh initial_mesh;
swage::Mesh_t initial_mesh;
initial_mesh.num_dims = num_dims;
MPICArrayKokkos<double> initial_node_coords;

// Mesh partitioned by pt-scotch, including ghost
swage::Mesh final_mesh;
swage::Mesh_t final_mesh;
final_mesh.num_dims = num_dims;
node_t final_node;
MPICArrayKokkos<double> final_node_coords;

Expand Down
31 changes: 17 additions & 14 deletions examples/mesh_form/include/mesh_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int PointIndexFromIJK(int i, int j, int k, const int* order)
///
/////////////////////////////////////////////////////////////////////////////
void build_3d_box(
swage::Mesh& mesh,
swage::Mesh_t& mesh,
DCArrayKokkos<double>& node_coords,
double origin[3],
double length[3],
Expand Down Expand Up @@ -251,9 +251,9 @@ void build_3d_box(

// initialize elem variables
if (is_linear){
mesh.initialize_elems(num_elems, num_dim);
mesh.initialize_elems(num_elems);
} else {
mesh.initialize_elems_Pn(num_elems, num_dim, Pn_order);
mesh.initialize_elems_Pn(num_elems, Pn_order, 2*Pn_order);
}

// populate the point data structures
Expand Down Expand Up @@ -310,8 +310,9 @@ void build_3d_box(

// initialize corner variables (corner = element-node pair)
// used for per-corner data like corner_delta in mesh_mold.cpp
int num_corners = num_elems * mesh.num_nodes_in_elem;
mesh.initialize_corners(num_corners);
// the corners are initialized in initialize_elems
//int num_corners = num_elems * mesh.num_nodes_in_elem;
//mesh.initialize_corners(num_corners);

// Build connectivity
mesh.build_connectivity();
Expand All @@ -332,7 +333,7 @@ void build_3d_box(
///
/////////////////////////////////////////////////////////////////////////////
void build_2d_polar(
swage::Mesh& mesh,
swage::Mesh_t& mesh,
MPICArrayKokkos<double>& node_coords,
double& inner_radius,
double& outer_radius,
Expand Down Expand Up @@ -409,7 +410,7 @@ void build_2d_polar(
node_coords.update_device();

// initialize elem variables
mesh.initialize_elems(num_elems, num_dim);
mesh.initialize_elems(num_elems);

// populate the elem center data structures
for (int j = 0; j < num_elems_j; j++) {
Expand Down Expand Up @@ -444,8 +445,9 @@ void build_2d_polar(
mesh.nodes_in_elem.update_device();

// intialize corner variables
int num_corners = num_elems * mesh.num_nodes_in_elem;
mesh.initialize_corners(num_corners);
// this is initialized in initialize_elems
//int num_corners = num_elems * mesh.num_nodes_in_elem;
//mesh.initialize_corners(num_corners);
// corner.initialize(num_corners, num_dim);

// Build connectivity
Expand All @@ -466,7 +468,7 @@ void build_2d_polar(
/// \param comm MPI communicator
///
/////////////////////////////////////////////////////////////////////////////
void write_vtu(swage::Mesh& mesh,
void write_vtu(swage::Mesh_t& mesh,
node_t& node,
GaussPoint_t& gauss_point,
int rank,
Expand Down Expand Up @@ -864,7 +866,7 @@ void write_vtu(swage::Mesh& mesh,
/// \param Number of dimensions
///
/////////////////////////////////////////////////////////////////////////////
void read_vtk_mesh(swage::Mesh& mesh,
void read_vtk_mesh(swage::Mesh_t& mesh,
DCArrayKokkos<double>& node_coords,
int num_dims,
std::string mesh_file_)
Expand Down Expand Up @@ -964,7 +966,7 @@ found=false;
throw std::invalid_argument("Failed to parse CELLS header line: \"" + line + "\"");
}
printf("Number of elements read in %zu\n", num_elem);
mesh.initialize_elems(num_elem, num_dims);
mesh.initialize_elems(num_elem);
found = true;
break;
}
Expand Down Expand Up @@ -1097,8 +1099,9 @@ mesh.nodes_in_elem.update_device();


// initialize corner variables
size_t num_corners = num_elem * num_nodes_in_elem;
mesh.initialize_corners(num_corners);
// this is initialized in initialize_elems
//size_t num_corners = num_elem * num_nodes_in_elem;
//mesh.initialize_corners(num_corners);


// Build connectivity
Expand Down
2 changes: 1 addition & 1 deletion examples/mesh_form/src/mesh_form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char** argv) {


// Initial mesh built on rank zero
swage::Mesh mesh;
swage::Mesh_t mesh;
node_t node;
DCArrayKokkos<double> node_coords;

Expand Down
37 changes: 37 additions & 0 deletions examples/reference_element/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# examples/average/CMakeLists.txt

# 1. Define the executable
# Point directly to the source file inside 'src/'
add_executable(remap_fv_test src/remap_fv_test.cpp)
add_executable(remap_dg_test src/remap_dg_test.cpp)
add_executable(ref_flux_test src/ref_flux_test.cpp)
add_executable(ref_plus_mesh_test src/ref_plus_mesh_test.cpp)
add_executable(integration_test src/integration_test.cpp)
add_executable(gradient_test src/gradient_test.cpp)
add_executable(interpolation_test src/interpolation_test.cpp)
add_executable(kronecker_delta_test src/kronecker_delta_test.cpp)
add_executable(partition_unity_test src/partition_unity_test.cpp)

# 2. Add this example's specific include path
# This allows main.cpp to find headers in examples/point_connectivity/include/
target_include_directories(remap_fv_test PRIVATE include)
target_include_directories(remap_dg_test PRIVATE include)
target_include_directories(ref_flux_test PRIVATE include)
target_include_directories(ref_plus_mesh_test PRIVATE include)
target_include_directories(integration_test PRIVATE include)
target_include_directories(gradient_test PRIVATE include)
target_include_directories(interpolation_test PRIVATE include)
target_include_directories(kronecker_delta_test PRIVATE include)
target_include_directories(partition_unity_test PRIVATE include)

# 3. Link against the main library (ELEMENTS)
# This pulls in Kokkos, MATAR, and the main library headers automatically.
target_link_libraries(remap_fv_test PRIVATE ELEMENTS)
target_link_libraries(remap_dg_test PRIVATE ELEMENTS)
target_link_libraries(ref_flux_test PRIVATE ELEMENTS)
target_link_libraries(ref_plus_mesh_test PRIVATE ELEMENTS)
target_link_libraries(integration_test PRIVATE ELEMENTS)
target_link_libraries(gradient_test PRIVATE ELEMENTS)
target_link_libraries(interpolation_test PRIVATE ELEMENTS)
target_link_libraries(kronecker_delta_test PRIVATE ELEMENTS)
target_link_libraries(partition_unity_test PRIVATE ELEMENTS)
Loading
Loading