-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added coupled interfaces reader | mesh tests updated
- Loading branch information
1 parent
653509a
commit 723977c
Showing
17 changed files
with
296 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef _COUPLED_ACOUSTIC_POORELASTIC_HPP_ | ||
#define _COUPLED_ACOUSTIC_POORELASTIC_HPP_ | ||
|
||
#include "kokkos_abstractions.h" | ||
#include "specfem_mpi/interface.hpp" | ||
|
||
namespace specfem { | ||
namespace mesh { | ||
namespace coupled_interfaces { | ||
struct acoustic_poroelastic { | ||
public: | ||
acoustic_poroelastic(){}; | ||
acoustic_poroelastic(const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi); | ||
int num_interfaces; | ||
specfem::kokkos::HostView1d<int> acoustic_ispec; | ||
specfem::kokkos::HostView1d<int> poroelastic_ispec; | ||
}; | ||
} // namespace coupled_interfaces | ||
} // namespace mesh | ||
} // namespace specfem | ||
|
||
#endif /* _COUPLED_ACOUSTIC_POORELASTIC_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef _COUPLED_INTERFACES_HPP_ | ||
#define _COUPLED_INTERFACES_HPP_ | ||
|
||
#include "acoustic_poroelastic.hpp" | ||
#include "elastic_acoustic.hpp" | ||
#include "elastic_poroelastic.hpp" | ||
#include "specfem_mpi/interface.hpp" | ||
|
||
namespace specfem { | ||
namespace mesh { | ||
namespace coupled_interfaces { | ||
|
||
struct coupled_interfaces { | ||
public: | ||
coupled_interfaces() | ||
: elastic_acoustic(), acoustic_poroelastic(), elastic_poroelastic(){}; | ||
coupled_interfaces(std::ifstream &stream, | ||
const int num_interfaces_elastic_acoustic, | ||
const int num_interfaces_acoustic_poroelastic, | ||
const int num_interfaces_elastic_poroelastic, | ||
const specfem::MPI::MPI *mpi) | ||
: elastic_acoustic(num_interfaces_elastic_acoustic, stream, mpi), | ||
acoustic_poroelastic(num_interfaces_acoustic_poroelastic, stream, mpi), | ||
elastic_poroelastic(num_interfaces_elastic_poroelastic, stream, mpi){}; | ||
specfem::mesh::coupled_interfaces::elastic_acoustic elastic_acoustic; | ||
specfem::mesh::coupled_interfaces::elastic_poroelastic elastic_poroelastic; | ||
specfem::mesh::coupled_interfaces::acoustic_poroelastic acoustic_poroelastic; | ||
}; | ||
|
||
} // namespace coupled_interfaces | ||
} // namespace mesh | ||
} // namespace specfem | ||
#endif /* _COUPLED_INTERFACES_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef _COUPLED_ELASTIC_ACOUSTIC_HPP_ | ||
#define _COUPLED_ELASTIC_ACOUSTIC_HPP_ | ||
|
||
#include "kokkos_abstractions.h" | ||
#include "specfem_mpi/interface.hpp" | ||
|
||
namespace specfem { | ||
namespace mesh { | ||
namespace coupled_interfaces { | ||
struct elastic_acoustic { | ||
public: | ||
elastic_acoustic(){}; | ||
elastic_acoustic(const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi); | ||
|
||
int num_interfaces; | ||
specfem::kokkos::HostView1d<int> elastic_ispec; | ||
specfem::kokkos::HostView1d<int> acoustic_ispec; | ||
}; | ||
} // namespace coupled_interfaces | ||
} // namespace mesh | ||
} // namespace specfem | ||
|
||
#endif /* _COUPLED_ELASTIC_ACOUSTIC_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef _COUPLED_ELASTIC_POORELASTIC_HPP_ | ||
#define _COUPLED_ELASTIC_POORELASTIC_HPP_ | ||
|
||
#include "kokkos_abstractions.h" | ||
#include "specfem_mpi/interface.hpp" | ||
|
||
namespace specfem { | ||
namespace mesh { | ||
namespace coupled_interfaces { | ||
struct elastic_poroelastic { | ||
public: | ||
elastic_poroelastic(){}; | ||
elastic_poroelastic(const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi); | ||
int num_interfaces; | ||
specfem::kokkos::HostView1d<int> elastic_ispec; | ||
specfem::kokkos::HostView1d<int> poroelastic_ispec; | ||
}; | ||
} // namespace coupled_interfaces | ||
} // namespace mesh | ||
} // namespace specfem | ||
|
||
#endif /* _COUPLED_ELASTIC_POORELASTIC_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "mesh/coupled_interfaces/acoustic_poroelastic.hpp" | ||
#include "fortranio/interface.hpp" | ||
|
||
specfem::mesh::coupled_interfaces::acoustic_poroelastic::acoustic_poroelastic( | ||
const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi) | ||
: num_interfaces(num_interfaces), | ||
acoustic_ispec("acoustic_ispec", num_interfaces), | ||
poroelastic_ispec("poroelastic_ispec", num_interfaces) { | ||
|
||
if (!num_interfaces) | ||
return; | ||
|
||
int acoustic_ispec_l, poroelastic_ispec_l; | ||
|
||
for (int i = 0; i < num_interfaces; i++) { | ||
specfem::fortran_IO::fortran_read_line(stream, &poroelastic_ispec_l, | ||
&acoustic_ispec_l); | ||
acoustic_ispec(i) = acoustic_ispec_l; | ||
poroelastic_ispec(i) = poroelastic_ispec_l; | ||
} | ||
|
||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "mesh/coupled_interfaces/elastic_acoustic.hpp" | ||
#include "fortranio/interface.hpp" | ||
|
||
specfem::mesh::coupled_interfaces::elastic_acoustic::elastic_acoustic( | ||
const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi) | ||
: num_interfaces(num_interfaces), | ||
elastic_ispec("elastic_ispec", num_interfaces), | ||
acoustic_ispec("acoustic_ispec", num_interfaces) { | ||
|
||
if (!num_interfaces) | ||
return; | ||
|
||
int elastic_ispec_l, acoustic_ispec_l; | ||
|
||
for (int i = 0; i < num_interfaces; i++) { | ||
specfem::fortran_IO::fortran_read_line(stream, &acoustic_ispec_l, | ||
&elastic_ispec_l); | ||
elastic_ispec(i) = elastic_ispec_l; | ||
acoustic_ispec(i) = acoustic_ispec_l; | ||
} | ||
|
||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "mesh/coupled_interfaces/elastic_poroelastic.hpp" | ||
#include "fortranio/interface.hpp" | ||
|
||
specfem::mesh::coupled_interfaces::elastic_poroelastic::elastic_poroelastic( | ||
const int num_interfaces, std::ifstream &stream, | ||
const specfem::MPI::MPI *mpi) | ||
: num_interfaces(num_interfaces), | ||
elastic_ispec("elastic_ispec", num_interfaces), | ||
poroelastic_ispec("poroelastic_ispec", num_interfaces) { | ||
|
||
if (!num_interfaces) | ||
return; | ||
|
||
int elastic_ispec_l, poroelastic_ispec_l; | ||
|
||
for (int i = 0; i < num_interfaces; i++) { | ||
specfem::fortran_IO::fortran_read_line(stream, &poroelastic_ispec_l, | ||
&elastic_ispec_l); | ||
elastic_ispec(i) = elastic_ispec_l; | ||
poroelastic_ispec(i) = poroelastic_ispec_l; | ||
} | ||
|
||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.