Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anisotropy Implementation #257

Open
wants to merge 374 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
374 commits
Select commit Hold shift + click to select a range
2da22b6
Merge pull request #321 from PrincetonUniversity/issue-318
Rohit-Kakodkar Dec 20, 2024
b780266
Removed a lot of the stations for plotting
lsawade Dec 20, 2024
9640d47
Initial commit for macros
Rohit-Kakodkar Dec 18, 2024
516d527
Simplified template instantiations using macro
Rohit-Kakodkar Dec 18, 2024
8d449b6
Initial commit for kernels refactor
Rohit-Kakodkar Dec 18, 2024
1559205
Macro implementation frechet kernels
Rohit-Kakodkar Dec 18, 2024
a462a3f
Moved frechet derivatives computation to `specfem::medium`
Rohit-Kakodkar Dec 18, 2024
6a214d6
Added documentation
Rohit-Kakodkar Dec 18, 2024
1e8c936
Added documentation for material systems macro
Rohit-Kakodkar Dec 20, 2024
27f181d
Updated the trace plotting to only check 5 traces #s (10, 20, 30, 40…
lsawade Dec 20, 2024
48ce063
Added documentation
Rohit-Kakodkar Dec 19, 2024
e971909
Fixed pressure seismograms for anisotropic domains
Rohit-Kakodkar Dec 18, 2024
dbc1712
Update CMakeLists
icui Dec 20, 2024
86f9624
Update from 228
icui Dec 20, 2024
23fb148
Merge branch 'issue-228-anisotropy' into issue-316-further
icui Dec 20, 2024
170aa98
Update CMake
icui Dec 20, 2024
e9d105b
Merge pull request #331 from PrincetonUniversity/issue-316-further
icui Dec 20, 2024
a3efe63
Merge branch 'issue-228-anisotropy' into issue-306
icui Dec 20, 2024
9f55d20
Update error message
icui Dec 20, 2024
58de075
Element info class (templated)
icui Dec 19, 2024
d8e2e96
Merge pull request #308 from PrincetonUniversity/issue-306
icui Dec 20, 2024
a7d3595
Updated call for each macros definition
Rohit-Kakodkar Dec 20, 2024
f098ecc
Merge branch 'issue-318' into issue-260
Rohit-Kakodkar Dec 20, 2024
2aa134c
Added name feature in macro definitions
Rohit-Kakodkar Dec 20, 2024
dc66510
Merge pull request #336 from PrincetonUniversity/issue-318
Rohit-Kakodkar Dec 20, 2024
2c96cec
Property writer
icui Dec 20, 2024
a223252
Source impl with macros
Rohit-Kakodkar Dec 23, 2024
9b8722d
Working sources implementation
Rohit-Kakodkar Dec 23, 2024
8801474
removed commented code
Rohit-Kakodkar Dec 23, 2024
d73bbaf
Removed more comments
Rohit-Kakodkar Dec 23, 2024
37b7e9c
Merge branch 'issue-228-anisotropy' into issue-260
Rohit-Kakodkar Dec 23, 2024
b62eb6a
Added tests for compute sources
Rohit-Kakodkar Dec 23, 2024
538e3ed
Passing mesh and source information in test fixture
Rohit-Kakodkar Dec 23, 2024
a8b3d12
Fixed test fixture
Rohit-Kakodkar Dec 23, 2024
98cd66d
Added assembly sources constructor test
Rohit-Kakodkar Dec 23, 2024
a16a426
Rename lambdaplus2mu to kappa for acoustic
icui Dec 24, 2024
9c8cd56
Merge branch 'issue-340' into issue-307
icui Dec 24, 2024
ffe7fdd
Make kappa_inverse a derived property.
icui Dec 24, 2024
180ac6b
Merge branch 'issue-340' into issue-343
icui Dec 24, 2024
68e831b
Update formatting.
icui Dec 24, 2024
e9ad65d
Add parameter to skip material property assignment.
icui Dec 24, 2024
c30dacc
Property reader
icui Dec 26, 2024
6574ec5
revert example change
icui Dec 26, 2024
1b2b9e8
Moved content of material to medium
lsawade Dec 30, 2024
cd44fb5
Moved content of material to medium
lsawade Dec 30, 2024
94f058b
Removed the material files
lsawade Dec 30, 2024
f638f1a
Removed material files
lsawade Dec 30, 2024
33c0000
Removed material_class comments in CMakeLists.txt
lsawade Dec 30, 2024
53bd6d5
blub
lsawade Dec 30, 2024
257a11d
Moved back to previous commit
lsawade Dec 30, 2024
3051d4f
Moved material files to medium folder
lsawade Dec 30, 2024
2f321ca
Code compiles and most things are moved to medium/material etc.
lsawade Dec 30, 2024
2e8d7cb
Material is now fully incorporated into medium. But there is a a circ…
lsawade Dec 30, 2024
ca21404
Merge
lsawade Dec 30, 2024
5801c11
Updated sources to use macros
Rohit-Kakodkar Dec 30, 2024
d53f1dd
Merge pull request #338 from PrincetonUniversity/issue-260
Rohit-Kakodkar Dec 30, 2024
9430120
Merge branch 'issue-228-anisotropy' into issue-259
lsawade Dec 30, 2024
b690118
separated the acoustic_isotropic2d/acoustic_isotropic2d intro acousti…
lsawade Dec 30, 2024
a99fc06
Edited all include interfaces
lsawade Dec 30, 2024
6a6b4a4
Medium is split now
lsawade Dec 30, 2024
c3b6622
Fix GLL model argument in setup.
icui Dec 30, 2024
7f6934c
Merge pull request #342 from PrincetonUniversity/issue-340
icui Dec 30, 2024
273bec9
Updated compute wavefield to be a subview
Rohit-Kakodkar Dec 30, 2024
855d6a2
split up the elastic isotropic files
lsawade Dec 30, 2024
e387cf9
All medium files split such that we do not have a giant file for each…
lsawade Dec 30, 2024
21be154
All medium files split such that we do not have a giant file for each…
lsawade Dec 30, 2024
d512d40
All files are split, code compiles, and tests are passing!
lsawade Dec 30, 2024
43e7790
Merge branch 'issue-231' into issue-343
icui Dec 30, 2024
e1ed1d2
Update Python import
icui Dec 30, 2024
45c6ba6
Merge branch 'issue-231' into issue-343
icui Dec 30, 2024
5a5c8bd
Merge branch 'issue-228-anisotropy' into issue-259
lsawade Dec 31, 2024
ee5bd26
Merge pull request #349 from PrincetonUniversity/issue-259
lsawade Dec 31, 2024
38b7210
Removed remnant file
lsawade Dec 31, 2024
28f17a2
The code is compiling and running. Restructuring medium now to allow …
lsawade Dec 31, 2024
2cb6357
Forgot the explicit template instantiations in the source files
lsawade Dec 31, 2024
cf6e1d7
Restructured medium
lsawade Dec 31, 2024
f6e0679
Everything compiles again. Fully restructured medium.
lsawade Dec 31, 2024
5b0c96e
We are compiling
lsawade Dec 31, 2024
901911a
Added macro but not workin
lsawade Jan 2, 2025
8c02b04
Refactor reader
icui Jan 2, 2025
ff522a2
Update cmake
icui Jan 2, 2025
d4b2865
Fix setup constructor
icui Jan 2, 2025
d96e8ea
Fixed some function signature that I erroneously wrote (false/true) c…
lsawade Jan 3, 2025
cfd3a43
Completing the merge
lsawade Jan 3, 2025
7f6d405
Missed a strange change in the cmakelists no idea why that was workin…
lsawade Jan 3, 2025
6aa86fc
Merged upstream updates
lsawade Jan 3, 2025
ec918ac
2d -> dim2
lsawade Jan 3, 2025
15ec75d
Merge pull request #359 from PrincetonUniversity/issue-319
lsawade Jan 3, 2025
2a216cd
move property reader to assembly constructor.
icui Jan 3, 2025
8623532
refactor writer
icui Jan 3, 2025
b26a16b
Moved all medium specific files from compute/properties/impl to mediu…
lsawade Jan 6, 2025
d3f9836
Meging previous commit
lsawade Jan 6, 2025
803a580
Removed remnant elastic anisotropic kernel.hpp
lsawade Jan 6, 2025
a7f4a77
Moved everything from compute/kernels/impl to medium
lsawade Jan 6, 2025
f73f06a
Moved everything from compute/kernels/impl -> medium/
lsawade Jan 6, 2025
b8a98e5
Moved medium/frechet_derivative.hpp to medium/compute_frechet_derivat…
lsawade Jan 6, 2025
fc7c193
Revert "Moved medium/frechet_derivative.hpp to medium/compute_frechet…
lsawade Jan 7, 2025
b805793
Had to revert changes, because i accidentally removed and later added…
lsawade Jan 7, 2025
f4c1480
Fixed iterator_index typo
lsawade Jan 7, 2025
4d61e5a
Test store_on_host and load_on_device for properties.
icui Jan 7, 2025
77a7bc3
Refactored receiver struct
Rohit-Kakodkar Jan 8, 2025
d00416a
Receiver documentation update
Rohit-Kakodkar Jan 8, 2025
f5b529b
Updated seismogram writer and the trace naming scheme
Rohit-Kakodkar Jan 8, 2025
ae8d037
Updated receiver kernel to use compute wavefield
Rohit-Kakodkar Jan 8, 2025
abd4a96
Compilation fix
Rohit-Kakodkar Jan 8, 2025
6c4903b
Test reader, writer and compute_to_mesh.
icui Jan 8, 2025
3530f8f
Update formatting.
icui Jan 8, 2025
df16e57
Merge branch 'issue-228-anisotropy' into issue-354
icui Jan 9, 2025
5e025fa
Update static_cast
icui Jan 9, 2025
add12ce
Merge pull request #362 from PrincetonUniversity/issue-352
lsawade Jan 9, 2025
2401977
Merge pull request #364 from PrincetonUniversity/issue-363
lsawade Jan 9, 2025
9a74cc7
Merge branch 'issue-228-anisotropy' into issue-354
icui Jan 9, 2025
65fbb24
Merge branch 'issue-228-anisotropy' into issue-343
icui Jan 9, 2025
12dd65d
Merge pull request #366 from PrincetonUniversity/compute_receiver_ref…
Rohit-Kakodkar Jan 9, 2025
35b11f6
Use macro for material tests
icui Jan 9, 2025
1af33fa
Update kernel test
icui Jan 9, 2025
027f40f
Refactor reader
icui Jan 9, 2025
f1c6b25
Refactor writer
icui Jan 9, 2025
668d9b7
Merge fix.
icui Jan 10, 2025
0f684da
Merge pull request #367 from PrincetonUniversity/receiver_kernel_refa…
Rohit-Kakodkar Jan 10, 2025
e5400f6
Update comments.
icui Jan 10, 2025
190fe0f
Merge branch 'issue-354' into issue-343
icui Jan 10, 2025
42cdfcc
Merge branch 'issue-343' into issue-370
icui Jan 10, 2025
94212bc
Remove unused explicit template instantiation
icui Jan 10, 2025
323a42a
Add cookbook for anisotropic simulation.
icui Jan 10, 2025
2f28f49
Add trace and wavefield figures to anisotropic cookbook.
icui Jan 10, 2025
c67c457
Merge branch 'devel' into issue-228-anisotropy for easier merging in
lsawade Jan 13, 2025
4ae0832
Updated traces | Updated cookbook documentation
Rohit-Kakodkar Jan 13, 2025
e0fc554
Remove unused HDF5/native_type.cpp
icui Jan 13, 2025
02e4b58
Merge pull request #371 from PrincetonUniversity/issue-370
icui Jan 13, 2025
cafebb2
Merge pull request #378 from PrincetonUniversity/issue-374
icui Jan 13, 2025
60673dd
Fix CUDA compilation
icui Jan 13, 2025
d10bdf3
Merge pull request #348 from PrincetonUniversity/issue-343
icui Jan 14, 2025
f2d25e0
Update examples
icui Jan 14, 2025
3b92211
Add explanation for CUDA fix.
icui Jan 14, 2025
02a93f7
Merge pull request #376 from PrincetonUniversity/issue-375
icui Jan 14, 2025
5b14db7
Added overload to read_sources()
lsawade Jan 14, 2025
10fe435
Fix scikit-build compilation error.
icui Jan 14, 2025
485666c
Added test to read moment tensor source.
lsawade Jan 14, 2025
a58f60d
Forgot to add the test to the google_test_discover part
lsawade Jan 15, 2025
1502880
Merge pull request #401 from PrincetonUniversity/issue-395
lsawade Jan 15, 2025
5039c13
Fixed installables for the python installation
lsawade Jan 15, 2025
a87e246
Conflicts resolved..
lsawade Jan 15, 2025
28751be
Update CMake config.
icui Jan 15, 2025
9e22d75
this adds capability to add a source into the yaml tree
lsawade Jan 15, 2025
4ac2762
Merge branch 'issue-228-anisotropy' into issue-394-src-rcv-python
lsawade Jan 15, 2025
3262476
Merge branch 'issue-394-src-rcv-python' of github.com:PrincetonUniver…
lsawade Jan 15, 2025
bda25d2
Merge branch 'issue-394-src-rcv-python' into issue-395
lsawade Jan 15, 2025
c2ac40b
Promoted element_types from impl namespace to compute namespace
Rohit-Kakodkar Jan 16, 2025
d64dc7c
Merge branch 'issue-228-anisotropy' into issue-351
Rohit-Kakodkar Jan 16, 2025
518180d
Fixed merge issues
Rohit-Kakodkar Jan 16, 2025
e07fe01
Merge branch 'issue-351' into issue-278
Rohit-Kakodkar Jan 16, 2025
be31354
Merge pull request #403 from PrincetonUniversity/issue-395
lsawade Jan 16, 2025
f02975b
Merging updates from devel into anisotropy branch. Fixed meshfem3d co…
lsawade Jan 16, 2025
c96802b
Brought the Anisotropic Crystal example to the new format
lsawade Jan 16, 2025
fe62404
Fixed the anisotropic crystal example
lsawade Jan 16, 2025
7984eb8
Add tests for load_on_host
icui Jan 16, 2025
8469d4f
Add const.
icui Jan 16, 2025
a9e95af
first commit to add receiver reading through YAML
lsawade Jan 16, 2025
2f73146
Merge branch 'issue-394-src-rcv-python' into issue-406
lsawade Jan 16, 2025
cf1c2ca
Merged upstream
lsawade Jan 16, 2025
bc51df1
Add tests for derived properties.
icui Jan 16, 2025
da90a6e
Remove outdated tests in tests/compute
icui Jan 16, 2025
bf0df9f
Update formatting.
icui Jan 16, 2025
40704cb
Remove sprintf
icui Jan 16, 2025
c85f503
I really do not like the way this is done. receivers can now have a s…
lsawade Jan 16, 2025
e6862aa
Put the onus of deciding what format the stations-file is into the re…
lsawade Jan 16, 2025
57abbcc
Fixed grabbing the stations-file from the stations-node.
lsawade Jan 16, 2025
b232002
merged upstream updates
lsawade Jan 16, 2025
87f5c8f
Complete merge
lsawade Jan 16, 2025
7b6434d
Domain kernel refactor initial commit
Rohit-Kakodkar Jan 17, 2025
d8b1848
Minor updates
Rohit-Kakodkar Jan 17, 2025
444403e
Moved material derivatives to impl namespace
Rohit-Kakodkar Jan 17, 2025
9e5d9ef
Added compute_mass_matrix to impl namespace
Rohit-Kakodkar Jan 17, 2025
b1fa661
Added invert_mass_matrix & divide_mass_matrix to impl namespace
Rohit-Kakodkar Jan 17, 2025
273bd1a
Added compute_siesmogram to impl namespace
Rohit-Kakodkar Jan 17, 2025
8133de0
Merge pull request #405 from PrincetonUniversity/issue-351
Rohit-Kakodkar Jan 17, 2025
e1fe5bf
Compilation fix
Rohit-Kakodkar Jan 17, 2025
0fe0e83
Added compute_stiffness and compute_source to impl namespace
Rohit-Kakodkar Jan 17, 2025
1ce600f
Removed unnacessary files
Rohit-Kakodkar Jan 17, 2025
2f194d5
Removed boundary conditions out of domain namespace
Rohit-Kakodkar Jan 17, 2025
d838199
Removed domain folder
Rohit-Kakodkar Jan 17, 2025
f9d81db
Moved kernels to kokkos_kernels namespace
Rohit-Kakodkar Jan 17, 2025
6c7ec4e
Moved kernels to domain_kernels
Rohit-Kakodkar Jan 17, 2025
d66f6cf
Removed commented code
Rohit-Kakodkar Jan 17, 2025
c6e6e33
Removed commented code
Rohit-Kakodkar Jan 17, 2025
71fd508
Removed a constexpr error
Rohit-Kakodkar Jan 17, 2025
c5306cf
Removed value containers
Rohit-Kakodkar Jan 17, 2025
2195d08
Merge pull request #410 from PrincetonUniversity/issue-409-1
icui Jan 17, 2025
1207b83
Merge pull request #408 from PrincetonUniversity/issue-379
icui Jan 17, 2025
070b27e
Updated wavefield snapshot naming, to zero pad for easier globbing
lsawade Jan 17, 2025
b8da2f7
Updated the docs to only refer to the read function that read from fi…
lsawade Jan 17, 2025
9e3190e
Updated source-file to always be called sources. It can now be define…
lsawade Jan 17, 2025
35f2ecd
Moved sources from databases to its own space in the runtime config
lsawade Jan 17, 2025
7beffb0
Removed the -file from the stations-file descriptor
lsawade Jan 17, 2025
0c96a69
Fixed kernel example
lsawade Jan 17, 2025
5641d01
Merge branch 'issue-228-anisotropy' into issue-278
Rohit-Kakodkar Jan 18, 2025
d052e85
Fixed CUDA compilation issue
Rohit-Kakodkar Jan 18, 2025
7f1c032
Added precomputed element variables to improve performance
Rohit-Kakodkar Jan 21, 2025
a085561
Updated sources so elements are cached during constructionn
Rohit-Kakodkar Jan 21, 2025
19dc69d
Cache indices for receivers
Rohit-Kakodkar Jan 21, 2025
153407f
fixed the sources parameters documenation
lsawade Jan 21, 2025
83a7607
Rename plotter -> periodic_tasks
icui Jan 21, 2025
b890c07
Change plotters -> tasks
icui Jan 21, 2025
450d15a
Fixed inconsistent indentation of the meshfem2d CMakelists
lsawade Jan 21, 2025
a016599
Check ctrl-c signal.
icui Jan 21, 2025
cd832dd
Merge branch 'issue-228-anisotropy' into issue-389
icui Jan 21, 2025
3ad3abd
Update Snakefile
icui Jan 21, 2025
be0889b
Delete unused .in
icui Jan 21, 2025
d1e9d2c
Update Snakefile.
icui Jan 21, 2025
43e9edf
Merge pull request #393 from PrincetonUniversity/issue-389
icui Jan 21, 2025
de1d7a2
Fixed adj_seismogram
lsawade Jan 21, 2025
9b81ec9
Revert name change.
icui Jan 21, 2025
7b4429b
Seismograms were only written until nt < nstep - 1 writing on to few …
lsawade Jan 21, 2025
a92f9fb
Anisotropic crystal example broken. Multiple receivers in one element.
lsawade Jan 21, 2025
83cb405
Fixed remaining examples
lsawade Jan 21, 2025
ff990e6
Fixed TROMP 2005 again
lsawade Jan 21, 2025
aa33f75
Switched the reading of network and stations
lsawade Jan 21, 2025
fb0e3a0
Merge pull request #397 from PrincetonUniversity/issue-394-src-rcv-py…
lsawade Jan 21, 2025
c08ef4c
Fixed the Examples and the tests after correcting the network and sta…
lsawade Jan 21, 2025
c3ed7de
Merge branch 'issue-228-anisotropy' into issue-414
icui Jan 21, 2025
bbc92bf
Removed unnaccessary files
Rohit-Kakodkar Jan 22, 2025
e41d8df
Merge pull request #413 from PrincetonUniversity/issue-278
Rohit-Kakodkar Jan 22, 2025
5fceec0
Merge pull request #419 from PrincetonUniversity/issue-411
lsawade Jan 22, 2025
2cedc2c
Merge branch 'issue-228-anisotropy' into issue-414
icui Jan 22, 2025
248df4c
merge fix.
icui Jan 22, 2025
57170fa
All relevant macros for compute_sources are written and update
lsawade Jan 23, 2025
b987f28
Partially reverted the compute_source_interaction to isolate new macr…
lsawade Jan 23, 2025
15b9871
Allow multiple receivers in an element.
icui Jan 23, 2025
0ef703a
Delete unexpected file.
icui Jan 23, 2025
aa7ad12
Rename iterator.
icui Jan 23, 2025
f1925d4
Fixed some bugs in the macros
lsawade Jan 23, 2025
d73e622
Tests passed
lsawade Jan 23, 2025
a69e028
Updated boost and kokkos modules
Rohit-Kakodkar Jan 24, 2025
94164cc
Added a bunch of comments
lsawade Jan 24, 2025
2631cf6
Update index_type for chunk policy.
icui Jan 24, 2025
4551650
Add station test.
icui Jan 24, 2025
468b9ef
Draft version without mappend_chunk_index implementation
lsawade Jan 24, 2025
c783e08
Merge pull request #415 from PrincetonUniversity/issue-414
icui Jan 24, 2025
f7d8c2f
Added Updated the the source_medium load_on_device and store_on_devic…
lsawade Jan 24, 2025
5d73a1e
Updated naming of the the iterators for more clarity
lsawade Jan 24, 2025
764ac3c
Updated naming of the the iterators for more clarity
lsawade Jan 24, 2025
fa6cef6
Update all arrays in compute sources to be a function of sources.size…
lsawade Jan 24, 2025
7c9da2c
Fixed final remnants of ispec in compute/sources/sources
lsawade Jan 24, 2025
ff3929d
Merge pull request #429 from PrincetonUniversity/issue-428
lsawade Jan 24, 2025
f09667d
Merge pull request #425 from PrincetonUniversity/issue-422
lsawade Jan 27, 2025
da5091f
Merge pull request #427 from PrincetonUniversity/issue-421
lsawade Jan 27, 2025
6213c8c
Add kokkos_function.
icui Jan 27, 2025
68e2f7b
Receiver fix.
icui Jan 27, 2025
01a13a4
Merge pull request #438 from PrincetonUniversity/issue-437
icui Jan 27, 2025
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
Prev Previous commit
Next Next commit
Initial commit for macros
  • Loading branch information
Rohit-Kakodkar authored and icui committed Dec 20, 2024
commit 9640d47be31ee260cd8183568b818ca005e03da1
145 changes: 145 additions & 0 deletions include/enumerations/material_definitions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#pragma once

#include "medium.hpp"
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/transform.hpp>
#include <tuple>

namespace specfem {
namespace element {

#define DIMENSION_TAG_DIM2 (0, specfem::dimension::type::dim2)

#define MEDIUM_TAG_ELASTIC (0, specfem::element::medium_tag::elastic)
#define MEDIUM_TAG_ACOUSTIC (1, specfem::element::medium_tag::acoustic)

#define PROPERTY_TAG_ISOTROPIC (0, specfem::element::property_tag::isotropic)
#define PROPERTY_TAG_ANISOTROPIC \
(1, specfem::element::property_tag::anisotropic)

#define BOUNDARY_TAG_NONE (0, specfem::element::boundary_tag::none)
#define BOUNDARY_TAG_STACEY (1, specfem::element::boundary_tag::stacey)
#define BOUNDARY_TAG_ACOUSTIC_FREE_SURFACE \
(2, specfem::element::boundary_tag::acoustic_free_surface)
#define BOUNDARY_TAG_COMPOSITE_STACEY_DIRICHLET \
(3, specfem::element::boundary_tag::composite_stacey_dirichlet)

#define MEDIUM_TYPES (MEDIUM_TAG_ELASTIC)(MEDIUM_TAG_ACOUSTIC)

#define GET_ID(s, data, elem) BOOST_PP_TUPLE_ELEM(0, elem)
#define GET_TAG(s, data, elem) BOOST_PP_TUPLE_ELEM(1, elem)

constexpr auto medium_types() {
// Use boost preprocessor library to generate a list of medium types
constexpr int total_medium_types = BOOST_PP_SEQ_SIZE(MEDIUM_TYPES);
constexpr std::array<medium_tag, total_medium_types> medium_types{
BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(GET_TAG, _, MEDIUM_TYPES))
};

return medium_types;
}

// Helper macro to transform each element in the sequence into a std::pair
#define MAKE_ARRAY_ELEM(s, data, elem) \
std::make_tuple(GET_TAG(s, data, BOOST_PP_TUPLE_ELEM(0, elem)), \
GET_TAG(s, data, BOOST_PP_TUPLE_ELEM(1, elem)))

// Generate a constexpr std::array
#define MAKE_CONSTEXPR_ARRAY(seq) \
BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(MAKE_ARRAY_ELEM, _, seq))

// Define your sequence
#define MATERIAL_SYSTEMS \
((MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ISOTROPIC))( \
(MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ANISOTROPIC))( \
(MEDIUM_TAG_ACOUSTIC, PROPERTY_TAG_ISOTROPIC))

constexpr auto material_systems() {
// Use boost preprocessor library to generate a list of material systems
constexpr int total_material_systems = BOOST_PP_SEQ_SIZE(MATERIAL_SYSTEMS);
constexpr std::array<
std::tuple<specfem::element::medium_tag, specfem::element::property_tag>,
total_material_systems>
material_systems{ MAKE_CONSTEXPR_ARRAY(MATERIAL_SYSTEMS) };

return material_systems;
}

#undef MAKE_ARRAY_ELEM

#define ELEMENT_TYPES \
((MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ISOTROPIC, BOUNDARY_TAG_NONE))( \
(MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ISOTROPIC, BOUNDARY_TAG_STACEY))( \
(MEDIUM_TAG_ACOUSTIC, PROPERTY_TAG_ISOTROPIC, BOUNDARY_TAG_NONE))( \
(MEDIUM_TAG_ACOUSTIC, PROPERTY_TAG_ISOTROPIC, \
BOUNDARY_TAG_ACOUSTIC_FREE_SURFACE))( \
(MEDIUM_TAG_ACOUSTIC, PROPERTY_TAG_ISOTROPIC, BOUNDARY_TAG_STACEY))( \
(MEDIUM_TAG_ACOUSTIC, PROPERTY_TAG_ISOTROPIC, \
BOUNDARY_TAG_COMPOSITE_STACEY_DIRICHLET))( \
(MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ANISOTROPIC, BOUNDARY_TAG_NONE))( \
(MEDIUM_TAG_ELASTIC, PROPERTY_TAG_ANISOTROPIC, BOUNDARY_TAG_STACEY))

#define MAKE_ARRAY_ELEM(s, data, elem) \
std::make_tuple(GET_TAG(s, data, BOOST_PP_TUPLE_ELEM(0, elem)), \
GET_TAG(s, data, BOOST_PP_TUPLE_ELEM(1, elem)), \
GET_TAG(s, data, BOOST_PP_TUPLE_ELEM(2, elem)))

constexpr auto element_types() {
// Use boost preprocessor library to generate a list of material systems
constexpr int total_element_types = BOOST_PP_SEQ_SIZE(ELEMENT_TYPES);
constexpr std::array<
std::tuple<specfem::element::medium_tag, specfem::element::property_tag,
specfem::element::boundary_tag>,
total_element_types>
material_systems{ MAKE_CONSTEXPR_ARRAY(ELEMENT_TYPES) };

return material_systems;
}

#undef MAKE_CONSTEXPR_ARRAY
#undef MAKE_ARRAY_ELEM

#define ELEM_IN_TUPLE(s, elem, tuple) \
BOOST_PP_IF( \
BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple), 3), \
BOOST_PP_IF( \
BOOST_PP_EQUAL(GET_ID(s, _, BOOST_PP_TUPLE_ELEM(0, tuple)), \
GET_ID(s, _, BOOST_PP_TUPLE_ELEM(0, elem))), \
BOOST_PP_IF( \
BOOST_PP_EQUAL(GET_ID(s, _, BOOST_PP_TUPLE_ELEM(1, tuple)), \
GET_ID(s, _, BOOST_PP_TUPLE_ELEM(1, elem))), \
BOOST_PP_IF( \
BOOST_PP_EQUAL(GET_ID(s, _, BOOST_PP_TUPLE_ELEM(2, tuple)), \
GET_ID(s, _, BOOST_PP_TUPLE_ELEM(2, elem))), \
1, 0), \
0), \
0), \
0)

#define OP_OR(s, state, elem) BOOST_PP_OR(state, elem)

#define ELEM_IN_SEQUENCE(elem) \
BOOST_PP_SEQ_FOLD_LEFT( \
OP_OR, 0, BOOST_PP_SEQ_TRANSFORM(ELEM_IN_TUPLE, elem, ELEMENT_TYPES))

#define WHERE(...) (BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))

#define CALL_FOR_ONE_SEQUENCE(s, MACRO, elem) \
BOOST_PP_IF( \
ELEM_IN_SEQUENCE((BOOST_PP_SEQ_ENUM(elem))), \
MACRO(GET_TAG(s, _, BOOST_PP_TUPLE_ELEM(0, (BOOST_PP_SEQ_ENUM(elem)))), \
GET_TAG(s, _, BOOST_PP_TUPLE_ELEM(1, (BOOST_PP_SEQ_ENUM(elem)))), \
GET_TAG(s, _, BOOST_PP_TUPLE_ELEM(2, (BOOST_PP_SEQ_ENUM(elem))))), \
0)

#define CREATE_SEQ(r, elem) (elem)

#define CALL_MACRO_FOR_ALL_ELEMENT_TYPES(MACRO, seq) \
BOOST_PP_SEQ_FOR_EACH(CALL_FOR_ONE_SEQUENCE, MACRO, \
BOOST_PP_SEQ_FOR_EACH_PRODUCT(CREATE_SEQ, seq))

} // namespace element
} // namespace specfem
46 changes: 0 additions & 46 deletions include/enumerations/medium.hpp
Original file line number Diff line number Diff line change
@@ -35,52 +35,6 @@ enum class boundary_tag {
composite_stacey_dirichlet
};

constexpr auto medium_types() {
constexpr int total_medium_types = 2;
constexpr std::array<medium_tag, total_medium_types> medium_types{
medium_tag::elastic, medium_tag::acoustic
};
return medium_types;
}

constexpr auto material_systems() {
constexpr int total_material_systems = 3;
constexpr
std::array<std::tuple<medium_tag, property_tag>, total_material_systems>
material_systems{
std::make_tuple(medium_tag::elastic, property_tag::isotropic),
std::make_tuple(medium_tag::elastic, property_tag::anisotropic),
std::make_tuple(medium_tag::acoustic, property_tag::isotropic)
};
return material_systems;
}

constexpr auto element_types() {
constexpr int total_element_types = 8;
constexpr std::array<std::tuple<medium_tag, property_tag, boundary_tag>,
total_element_types>
element_types{
std::make_tuple(medium_tag::elastic, property_tag::isotropic,
boundary_tag::none),
std::make_tuple(medium_tag::elastic, property_tag::isotropic,
boundary_tag::stacey),
std::make_tuple(medium_tag::elastic, property_tag::anisotropic,
boundary_tag::none),
std::make_tuple(medium_tag::elastic, property_tag::anisotropic,
boundary_tag::stacey),
std::make_tuple(medium_tag::acoustic, property_tag::isotropic,
boundary_tag::none),
std::make_tuple(medium_tag::acoustic, property_tag::isotropic,
boundary_tag::acoustic_free_surface),
std::make_tuple(medium_tag::acoustic, property_tag::isotropic,
boundary_tag::stacey),
std::make_tuple(medium_tag::acoustic, property_tag::isotropic,
boundary_tag::composite_stacey_dirichlet)
};

return element_types;
}

template <specfem::dimension::type Dimension,
specfem::element::medium_tag MediumTag>
class attributes;
1 change: 1 addition & 0 deletions src/compute/compute_mesh.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "compute/interface.hpp"
#include "enumerations/interface.hpp"
#include "enumerations/material_definitions.hpp"
#include "jacobian/interface.hpp"
#include "kokkos_abstractions.h"
#include "quadrature/interface.hpp"