Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,6 @@ else(SPECFEM_ENABLE_DOUBLE_PRECISION)
set(TYPE_REAL "float")
endif(SPECFEM_ENABLE_DOUBLE_PRECISION)

# Configure the setup headers
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup/specfem_setup.hpp.in
${CMAKE_BINARY_DIR}/include/specfem_setup.hpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup/constants.hpp.in
${CMAKE_BINARY_DIR}/include/constants.hpp)

# Add the configure files to the clean target
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
${CMAKE_BINARY_DIR}/include/specfem_setup.hpp
${CMAKE_BINARY_DIR}/include/constants.hpp
)

# Add the include directories so that the generated files can be found
include_directories(core)
include_directories(${CMAKE_SOURCE_DIR}/include)
Expand Down
12 changes: 4 additions & 8 deletions core/specfem.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "constants.hpp"
#include "specfem/constants.hpp"
#include "specfem/logger.hpp"
#include "specfem/program.hpp"
#include "specfem/program/context.hpp"
Expand Down Expand Up @@ -29,9 +29,7 @@ boost::program_options::options_description define_specfem_args() {
// Add basic options
desc.add_options()("help,h", "Print this help message")(
"parameters_file,p", po::value<std::string>()->required(),
"Location to parameters file")(
"default_file", po::value<std::string>()->default_value(__default_file__),
"Location of default parameters file.");
"Location to parameters file");

// Add logger options
desc.add_options()(
Expand Down Expand Up @@ -120,11 +118,9 @@ int main(int argc, char **argv) {
// Extract parameters (dimension is already extracted as positional
// argument)
const std::string parameters_file = vm["parameters_file"].as<std::string>();
const std::string default_file = vm["default_file"].as<std::string>();

// Load configuration files
// Load configuration file
const YAML::Node parameter_dict = YAML::LoadFile(parameters_file);
const YAML::Node default_dict = YAML::LoadFile(default_file);

// Extract and apply Logger options from parsed arguments
auto logger_options =
Expand All @@ -140,7 +136,7 @@ int main(int argc, char **argv) {

// Execute program with the specified dimension
const auto success =
specfem::program::execute(dimension, parameter_dict, default_dict);
specfem::program::execute(dimension, parameter_dict);

// Check execution result
if (!success) {
Expand Down
9 changes: 9 additions & 0 deletions core/specfem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Configure setup.hpp from setup.hpp.in
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.hpp.in
${CMAKE_BINARY_DIR}/include/specfem/setup.hpp)

# Add the configure file to the clean target
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
${CMAKE_BINARY_DIR}/include/specfem/setup.hpp
)

# Add existing subdirectories
add_subdirectory(algorithms)
add_subdirectory(assembly)
Expand Down
1 change: 0 additions & 1 deletion core/specfem/algorithms/gradient.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include "kokkos_abstractions.h"
#include "specfem/assembly.hpp"
#include "specfem/data_access.hpp"
#include "specfem/execution.hpp"
Expand Down
3 changes: 1 addition & 2 deletions core/specfem/algorithms/interpolate.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#pragma once

#include "kokkos_abstractions.h"
#include "specfem/datatype.hpp"
#include "specfem/execution.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

/**
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
Expand Up @@ -5,7 +5,7 @@
#include "specfem/assembly.hpp"
#include "specfem/jacobian.hpp"
#include "specfem/point.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>
#include <stdexcept>

Expand Down
2 changes: 2 additions & 0 deletions core/specfem/assembly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "assembly/boundary_values.hpp"
#include "assembly/conforming_interfaces.hpp"
#include "assembly/element_types.hpp"
#include "assembly/edge_types.hpp"
#include "assembly/face_types.hpp"
#include "assembly/fields.hpp"
#include "assembly/jacobian_matrix.hpp"
#include "assembly/kernels.hpp"
Expand Down
3 changes: 1 addition & 2 deletions core/specfem/assembly/compute_source_array.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#pragma once

#include "kokkos_abstractions.h"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
#include "specfem/assembly/mesh.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

namespace specfem::assembly {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#include "specfem/element.hpp"
#include "impl/compute_source_array_from_tensor.hpp"
#include "impl/compute_source_array_from_vector.hpp"
#include "kokkos_abstractions.h"
#include "specfem/assembly/compute_source_array.hpp"

#include "specfem/assembly/element_types.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

template<typename SourceArrayViewType>
template <typename SourceArrayViewType>
void specfem::assembly::compute_source_array(
const std::shared_ptr<
specfem::sources::source<specfem::element::dimension_tag::dim2> > &source,
Expand All @@ -20,7 +21,8 @@ void specfem::assembly::compute_source_array(
SourceArrayViewType &source_array) {

// Ensure source_array is a 3D view
static_assert(SourceArrayViewType::rank() == 3, "Source array must be in rank 3.");
static_assert(SourceArrayViewType::rank() == 3,
"Source array must be in rank 3.");

switch (source->get_source_type()) {
case specfem::sources::source_type::vector_source: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "compute_source_array_from_tensor.hpp"
#include "kokkos_abstractions.h"

#include "specfem/algorithms.hpp"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
Expand All @@ -8,7 +8,7 @@
#include "specfem/point.hpp"
#include "specfem/quadrature.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

namespace specfem::assembly::compute_source_array_impl {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "kokkos_abstractions.h"

#include "specfem/assembly/jacobian_matrix.hpp"
#include "specfem/assembly/mesh.hpp"
#include "specfem/source.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "compute_source_array_from_vector.hpp"
#include "kokkos_abstractions.h"

#include "specfem/algorithms.hpp"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
Expand All @@ -8,7 +8,7 @@
#include "specfem/point.hpp"
#include "specfem/quadrature.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

void specfem::assembly::compute_source_array_impl::from_vector(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "kokkos_abstractions.h"

#include "specfem/assembly/mesh.hpp"
#include "specfem/source.hpp"
#include <Kokkos_Core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#include "specfem/element.hpp"
#include "impl/compute_source_array_from_tensor.hpp"
#include "impl/compute_source_array_from_vector.hpp"
#include "kokkos_abstractions.h"
#include "specfem/assembly/compute_source_array.hpp"

#include "specfem/assembly/element_types.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

template<typename SourceArrayViewType>
template <typename SourceArrayViewType>
void specfem::assembly::compute_source_array(
const std::shared_ptr<
specfem::sources::source<specfem::element::dimension_tag::dim3> > &source,
Expand All @@ -20,8 +21,8 @@ void specfem::assembly::compute_source_array(
SourceArrayViewType &source_array) {

// Ensure source_array is a 4D view
static_assert(SourceArrayViewType::rank() == 4, "Source array must be in rank 4.");

static_assert(SourceArrayViewType::rank() == 4,
"Source array must be in rank 4.");

switch (source->get_source_type()) {
case specfem::sources::source_type::vector_source: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "compute_source_array_from_tensor.hpp"
#include "kokkos_abstractions.h"

#include "specfem/algorithms.hpp"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
Expand All @@ -8,7 +8,7 @@
#include "specfem/point.hpp"
#include "specfem/quadrature.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"

namespace specfem::assembly::compute_source_array_impl {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "kokkos_abstractions.h"

#include "specfem/assembly/jacobian_matrix.hpp"
#include "specfem/assembly/mesh.hpp"
#include "specfem/source.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "compute_source_array_from_vector.hpp"
#include "kokkos_abstractions.h"

#include "specfem/algorithms.hpp"
#include "specfem/assembly/element_types.hpp"
#include "specfem/assembly/jacobian_matrix.hpp"
Expand All @@ -8,7 +8,7 @@
#include "specfem/point.hpp"
#include "specfem/quadrature.hpp"
#include "specfem/source.hpp"
#include "specfem_setup.hpp"
#include "specfem/setup.hpp"
#include <Kokkos_Core.hpp>

void specfem::assembly::compute_source_array_impl::from_vector(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "kokkos_abstractions.h"

#include "specfem/assembly/mesh.hpp"
#include "specfem/source.hpp"
#include <Kokkos_Core.hpp>
Expand Down
Loading