Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 0 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,6 @@ set(CMAKE_MESSAGE_LOG_LEVEL ${_saved_CMAKE_MESSAGE_LOG_LEVEL})
# Add module subdirectories
add_subdirectory(core)

add_library(
enumerations
src/enumerations/display.cpp
src/enumerations/wavefield.cpp
src/enumerations/dim2/connections.cpp
src/enumerations/dim3/connections.cpp
src/enumerations/dim3/mesh_entities.cpp
src/enumerations/dim2/mesh_entities.cpp
src/enumerations/dim2/connections.cpp
src/enumerations/coupled_interface.cpp
)

target_link_libraries(
enumerations
${BOOST_LIBS}
Kokkos::kokkos
)

# specfem2d executable for backward compatibility
add_executable(specfem2d src/specfem2d.cpp)
target_link_libraries(specfem2d
Expand Down
7 changes: 7 additions & 0 deletions core/specfem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ add_subdirectory(algorithms)
add_subdirectory(assembly)
add_subdirectory(attenuation)
add_subdirectory(element)
add_subdirectory(element_connections)
add_subdirectory(enums)
add_subdirectory(jacobian)
add_subdirectory(compute)
add_subdirectory(io)
add_subdirectory(logger)
add_subdirectory(macros)
add_subdirectory(mesh)
add_subdirectory(mesh_entity)
add_subdirectory(mpi)
add_subdirectory(periodic_tasks)
add_subdirectory(point)
Expand All @@ -32,14 +35,18 @@ add_library(specfem::core ALIAS specfem_core_interface)
target_link_libraries(specfem_core_interface
INTERFACE
specfem::algorithms
specfem::attenuation
specfem::assembly
specfem::jacobian
specfem::compute
specfem::element
specfem::element_connections
specfem::enums
specfem::io
specfem::logger
specfem::macros
specfem::mesh
specfem::mesh_entity
specfem::mpi
specfem::periodic_tasks
specfem::point
Expand Down
4 changes: 2 additions & 2 deletions core/specfem/algorithms/coupling_integral.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "enumerations/interface.hpp"
#include "specfem/assembly.hpp"
#include "specfem/enums.hpp"
#include "specfem/execution.hpp"
#include "specfem/point.hpp"
#include <Kokkos_Core.hpp>
Expand Down Expand Up @@ -58,7 +58,7 @@ coupling_integral(const specfem::assembly::assembly<dimension_tag> &assembly,
const IntersectionFactor &intersection_factor,
const CallableType &callback) {

constexpr auto self_medium_tag = specfem::interface::attributes<
constexpr auto self_medium_tag = specfem::element_coupling::attributes<
dimension_tag, IntersectionFactor::interface_tag>::self_medium();

using PointIndexType =
Expand Down
2 changes: 1 addition & 1 deletion core/specfem/algorithms/locate_point.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "enumerations/mesh_entities.hpp"
#include "specfem/assembly.hpp"
#include "specfem/mesh_entity.hpp"
#include "specfem/point.hpp"

namespace specfem {
Expand Down
2 changes: 1 addition & 1 deletion core/specfem/algorithms/locate_point/dim2/locate_point.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "specfem/algorithms/locate_point.hpp"
#include "enumerations/mesh_entities.hpp"
#include "specfem/algorithms/locate_point/locate_point_impl.hpp"
#include "specfem/algorithms/locate_point/locate_point_impl.tpp"
#include "specfem/assembly.hpp"
#include "specfem/jacobian.hpp"
#include "specfem/mesh_entity.hpp"
#include "specfem/point.hpp"
#include "specfem_setup.hpp"
#include <Kokkos_Core.hpp>
Expand Down
14 changes: 7 additions & 7 deletions core/specfem/algorithms/transfer.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "enumerations/interface.hpp"
#include "specfem/data_access.hpp"
#include "specfem/enums.hpp"
#include "specfem/execution.hpp"
#include <Kokkos_Core.hpp>
#include <type_traits>
Expand All @@ -25,12 +25,12 @@ namespace specfem::algorithms {
into
* @ingroup AlgorithmsTransfer
*/
template <
typename IndexType, typename TransferFunctionType,
typename EdgeFunctionType, typename IntersectionReturnCallback,
typename std::enable_if_t<TransferFunctionType::connection_tag ==
specfem::connections::type::nonconforming,
int> = 0>
template <typename IndexType, typename TransferFunctionType,
typename EdgeFunctionType, typename IntersectionReturnCallback,
typename std::enable_if_t<
TransferFunctionType::connection_tag ==
specfem::element_connections::type::nonconforming,
int> = 0>
KOKKOS_INLINE_FUNCTION void
transfer(const IndexType &chunk_edge_index,
const TransferFunctionType &transfer_function,
Expand Down
2 changes: 1 addition & 1 deletion core/specfem/assembly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ target_link_libraries(
specfem::receivers
shape_functions
Kokkos::kokkos
enumerations
specfem::enums
${BOOST_LIBS}
$<$<BOOL:${SPECFEM_ENABLE_VTK}>:${VTK_LIBRARIES}>
)
Expand Down
2 changes: 1 addition & 1 deletion core/specfem/assembly/assembly.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "enumerations/interface.hpp"
#include "specfem/enums.hpp"

/**
* @namespace specfem::assembly
Expand Down
6 changes: 3 additions & 3 deletions core/specfem/assembly/assembly/dim2/assembly.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "specfem/assembly/assembly.hpp"
#include "enumerations/interface.hpp"
#include "specfem/assembly/info.hpp"
#include "specfem/enums.hpp"
#include "specfem/io.hpp"
#include "specfem/mesh.hpp"
#include "specfem/assembly/info.hpp"

specfem::assembly::assembly<specfem::element::dimension_tag::dim2>::assembly(
const specfem::mesh::mesh<dimension_tag> &mesh,
Expand All @@ -12,7 +12,7 @@ specfem::assembly::assembly<specfem::element::dimension_tag::dim2>::assembly(
const std::vector<std::shared_ptr<
specfem::receivers::receiver<specfem::element::dimension_tag::dim2> > >
&receivers,
const std::vector<specfem::wavefield::type> &stypes, const type_real t0,
const std::vector<specfem::enums::wavefield> &stypes, const type_real t0,
const type_real dt, const int max_timesteps, const int max_sig_step,
const int nsteps_between_samples,
const specfem::simulation::type simulation,
Expand Down
11 changes: 5 additions & 6 deletions core/specfem/assembly/assembly/dim2/assembly.hpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#pragma once

#include "enumerations/interface.hpp"
#include "specfem/assembly/boundaries.hpp"
#include "specfem/assembly/boundary_values.hpp"
#include "specfem/assembly/compute_source_array.hpp"
#include "specfem/assembly/conforming_interfaces.hpp"
#include "specfem/assembly/edge_types.hpp"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/info.hpp"
#include "specfem/assembly/fields.hpp"
#include "specfem/assembly/info.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
#include "specfem/assembly/kernels.hpp"
#include "specfem/assembly/mesh.hpp"
#include "specfem/assembly/nonconforming_interfaces.hpp"
#include "specfem/assembly/properties.hpp"
#include "specfem/assembly/receivers.hpp"
#include "specfem/assembly/sources.hpp"
#include "specfem/enums.hpp"
#include "specfem/mesh.hpp"
#include "specfem/receivers.hpp"
#include "specfem/source.hpp"
Expand Down Expand Up @@ -158,7 +158,7 @@ template <> struct assembly<specfem::element::dimension_tag::dim2> {

/**
* @brief Info
*
*
*/
specfem::assembly::Info<dimension_tag> info;

Expand Down Expand Up @@ -191,7 +191,7 @@ template <> struct assembly<specfem::element::dimension_tag::dim2> {
const std::vector<
std::shared_ptr<specfem::receivers::receiver<dimension_tag> > >
&receivers,
const std::vector<specfem::wavefield::type> &stypes, const type_real t0,
const std::vector<specfem::enums::wavefield> &stypes, const type_real t0,
const type_real dt, const int max_timesteps, const int max_sig_step,
const int nsteps_between_samples,
const specfem::simulation::type simulation,
Expand All @@ -211,7 +211,7 @@ template <> struct assembly<specfem::element::dimension_tag::dim2> {
Kokkos::View<type_real ****, Kokkos::LayoutLeft, Kokkos::HostSpace>
generate_wavefield_on_entire_grid(
const specfem::simulation::field_type wavefield,
const specfem::wavefield::type component);
const specfem::enums::wavefield component);

/**
* @brief Get the total number of spectral elements in the mesh
Expand Down Expand Up @@ -249,7 +249,6 @@ template <> struct assembly<specfem::element::dimension_tag::dim2> {
*
*/
void check_jacobian_matrix() const;

};

} // namespace specfem::assembly
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "enumerations/interface.hpp"
#include "specfem/assembly/assembly.hpp"
#include "specfem/enums.hpp"

#ifdef NO_VTK

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "enumerations/interface.hpp"
#include "specfem/assembly/assembly.hpp"
#include "specfem/assembly/assembly/impl/helper.hpp"
#include "specfem/enums.hpp"
#include "specfem/macros.hpp"
#include <Kokkos_Core.hpp>
#include <stdexcept>
Expand All @@ -11,7 +11,7 @@ namespace {
template <specfem::element::medium_tag MediumTag,
specfem::element::property_tag PropertyTag>
void get_wavefield_on_entire_grid(
const specfem::wavefield::type component,
const specfem::enums::wavefield component,
const specfem::assembly::assembly<specfem::element::dimension_tag::dim2>
&assembly,
Kokkos::View<type_real ****, Kokkos::LayoutLeft,
Expand Down Expand Up @@ -43,23 +43,23 @@ Kokkos::View<type_real ****, Kokkos::LayoutLeft, Kokkos::HostSpace>
specfem::assembly::assembly<specfem::element::dimension_tag::dim2>::
generate_wavefield_on_entire_grid(
const specfem::simulation::field_type wavefield,
const specfem::wavefield::type component) {
const specfem::enums::wavefield component) {

// Check which type of wavefield component is requested
const int ncomponents = [&]() -> int {
if (component == specfem::wavefield::type::displacement) {
if (component == specfem::enums::wavefield::displacement) {
return 2;
} else if (component == specfem::wavefield::type::velocity) {
} else if (component == specfem::enums::wavefield::velocity) {
return 2;
} else if (component == specfem::wavefield::type::acceleration) {
} else if (component == specfem::enums::wavefield::acceleration) {
return 2;
} else if (component == specfem::wavefield::type::pressure) {
} else if (component == specfem::enums::wavefield::pressure) {
return 1;
} else if (component == specfem::wavefield::type::rotation) {
} else if (component == specfem::enums::wavefield::rotation) {
return 2;
} else if (component == specfem::wavefield::type::intrinsic_rotation) {
} else if (component == specfem::enums::wavefield::intrinsic_rotation) {
return 2;
} else if (component == specfem::wavefield::type::curl) {
} else if (component == specfem::enums::wavefield::curl) {
return 2;
} else {
throw std::runtime_error("Wavefield component not supported");
Expand Down
5 changes: 2 additions & 3 deletions core/specfem/assembly/assembly/dim3/assembly.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "specfem/assembly/assembly.hpp"
#include "enumerations/interface.hpp"
#include "specfem/enums.hpp"
#include "specfem/io.hpp"
#include "specfem/mesh.hpp"

Expand All @@ -11,7 +11,7 @@ specfem::assembly::assembly<specfem::element::dimension_tag::dim3>::assembly(
const std::vector<
std::shared_ptr<specfem::receivers::receiver<dimension_tag> > >
&receivers,
const std::vector<specfem::wavefield::type> &stypes, const type_real t0,
const std::vector<specfem::enums::wavefield> &stypes, const type_real t0,
const type_real dt, const int max_timesteps, const int max_sig_step,
const int nsteps_between_samples,
const specfem::simulation::type simulation,
Expand Down Expand Up @@ -70,7 +70,6 @@ specfem::assembly::assembly<specfem::element::dimension_tag::dim3>::assembly(
// Currently done in the mesher!
this->check_jacobian_matrix();


this->info = { this->mesh, this->properties, this->element_types };

return;
Expand Down
11 changes: 5 additions & 6 deletions core/specfem/assembly/assembly/dim3/assembly.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include "enumerations/interface.hpp"
#include "specfem/assembly/boundaries.hpp"
#include "specfem/assembly/boundary_values.hpp"
#include "specfem/assembly/compute_source_array.hpp"
Expand All @@ -13,6 +12,7 @@
#include "specfem/assembly/properties.hpp"
#include "specfem/assembly/receivers.hpp"
#include "specfem/assembly/sources.hpp"
#include "specfem/enums.hpp"
#include "specfem/mesh.hpp"
#include "specfem/receivers.hpp"
#include "specfem/source.hpp"
Expand Down Expand Up @@ -114,9 +114,8 @@ template <> struct assembly<specfem::element::dimension_tag::dim3> {
///< the
///< boundaries

specfem::assembly::Info<dimension_tag>
info; ///< Information about the mesh and
///< simulation
specfem::assembly::Info<dimension_tag> info; ///< Information about the mesh
///< and simulation

///@}

Expand Down Expand Up @@ -147,7 +146,7 @@ template <> struct assembly<specfem::element::dimension_tag::dim3> {
const std::vector<
std::shared_ptr<specfem::receivers::receiver<dimension_tag> > >
&receivers,
const std::vector<specfem::wavefield::type> &stypes, const type_real t0,
const std::vector<specfem::enums::wavefield> &stypes, const type_real t0,
const type_real dt, const int max_timesteps, const int max_sig_step,
const int nsteps_between_samples,
const specfem::simulation::type simulation,
Expand All @@ -169,7 +168,7 @@ template <> struct assembly<specfem::element::dimension_tag::dim3> {
Kokkos::View<type_real *****, Kokkos::LayoutLeft, Kokkos::HostSpace>
generate_wavefield_on_entire_grid(
const specfem::simulation::field_type wavefield,
const specfem::wavefield::type component);
const specfem::enums::wavefield component);

/**
* @brief Get the total number of spectral elements in the mesh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "enumerations/interface.hpp"
#include "specfem/assembly/assembly.hpp"
#include "specfem/assembly/assembly/impl/helper.hpp"
#include "specfem/enums.hpp"
#include "specfem/macros.hpp"
#include <Kokkos_Core.hpp>
#include <stdexcept>
Expand All @@ -11,7 +11,7 @@ namespace {
template <specfem::element::medium_tag MediumTag,
specfem::element::property_tag PropertyTag>
void get_wavefield_on_entire_grid(
const specfem::wavefield::type component,
const specfem::enums::wavefield component,
const specfem::assembly::assembly<specfem::element::dimension_tag::dim3>
&assembly,
Kokkos::View<type_real *****, Kokkos::LayoutLeft,
Expand Down Expand Up @@ -43,23 +43,23 @@ Kokkos::View<type_real *****, Kokkos::LayoutLeft, Kokkos::HostSpace>
specfem::assembly::assembly<specfem::element::dimension_tag::dim3>::
generate_wavefield_on_entire_grid(
const specfem::simulation::field_type wavefield,
const specfem::wavefield::type component) {
const specfem::enums::wavefield component) {

// Check which type of wavefield component is requested
const int ncomponents = [&]() -> int {
if (component == specfem::wavefield::type::displacement) {
if (component == specfem::enums::wavefield::displacement) {
return 3;
} else if (component == specfem::wavefield::type::velocity) {
} else if (component == specfem::enums::wavefield::velocity) {
return 3;
} else if (component == specfem::wavefield::type::acceleration) {
} else if (component == specfem::enums::wavefield::acceleration) {
return 3;
} else if (component == specfem::wavefield::type::pressure) {
} else if (component == specfem::enums::wavefield::pressure) {
return 1;
} else if (component == specfem::wavefield::type::rotation) {
} else if (component == specfem::enums::wavefield::rotation) {
return 3;
} else if (component == specfem::wavefield::type::intrinsic_rotation) {
} else if (component == specfem::enums::wavefield::intrinsic_rotation) {
return 3;
} else if (component == specfem::wavefield::type::curl) {
} else if (component == specfem::enums::wavefield::curl) {
return 3;
} else {
throw std::runtime_error("Wavefield component not supported");
Expand Down
Loading
Loading