-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from AstroBarker/refactor_state
Refactor state
- Loading branch information
Showing
9 changed files
with
136 additions
and
23 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
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
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,34 @@ | ||
/** | ||
* File : state.cpp | ||
* -------------- | ||
* | ||
* Author : Brandon L. Barker | ||
* Purpose : Class for holding the state data. | ||
* | ||
* TODO: separate pOrder_fluid and pOrder_rad | ||
**/ | ||
|
||
#include "Constants.hpp" | ||
#include "state.hpp" | ||
|
||
State::State( const int nCF_, const int nCR_, const int nPF_, | ||
const int nAF_, const int nX_, const int nG_, | ||
const int nNodes_, const int pOrder_ ) | ||
: nCF( nCF_ ), nCR( nCR_ ), nPF( nPF_ ), nAF( nAF_ ), pOrder( pOrder_ ), | ||
uCF( "uCF", nCF_, nX_ + 2 * nG_, pOrder_ ), | ||
uPF( "uPF", nPF_, nX_ + 2 * nG_, nNodes_ ), | ||
uAF( "uAF", nAF_, nX_ + 2 * nG_, nNodes_ ), | ||
uCR( "uCR", nCR_, nX_ + 2 * nG_, pOrder_ ) {} | ||
|
||
// num var accessors | ||
int State::Get_nCF( ) const { return this->nCF; } | ||
int State::Get_nPF( ) const { return this->nPF; } | ||
int State::Get_nAF( ) const { return this->nAF; } | ||
int State::Get_nCR( ) const { return this->nCR; } | ||
int State::Get_pOrder( ) const { return this->pOrder; } | ||
|
||
// view accessors | ||
View3D State::Get_uCF( ) const { return this->uCF; } | ||
View3D State::Get_uPF( ) const { return this->uPF; } | ||
View3D State::Get_uAF( ) const { return this->uAF; } | ||
View3D State::Get_uCR( ) const { return this->uCR; } |
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,51 @@ | ||
#ifndef STATE_HPP_ | ||
#define STATE_HPP_ | ||
|
||
/** | ||
* File : state.hpp | ||
* -------------- | ||
* | ||
* Author : Brandon L. Barker | ||
* Purpose : Class for holding the state data. | ||
* | ||
* TODO: pull in eos | ||
* | ||
**/ | ||
|
||
#include "Kokkos_Core.hpp" | ||
|
||
#include "Abstractions.hpp" | ||
#include "Error.hpp" | ||
|
||
|
||
class State | ||
{ | ||
public: | ||
State( const int nCF_, const int nCR_, const int nPF_, const int nAF_, | ||
const int nX_, const int nG_, const int nNodes_, const int pOrder_ ); | ||
|
||
int Get_nCF( ) const; | ||
int Get_nCR( ) const; | ||
int Get_nPF( ) const; | ||
int Get_nAF( ) const; | ||
int Get_pOrder( ) const; | ||
|
||
View3D Get_uCF( ) const; | ||
View3D Get_uPF( ) const; | ||
View3D Get_uAF( ) const; | ||
View3D Get_uCR( ) const; | ||
|
||
private: | ||
int nCF; | ||
int nCR; | ||
int nPF; | ||
int nAF; | ||
int pOrder; | ||
|
||
View3D uCF; // Conserved fluid | ||
View3D uPF; // primitive fluid | ||
View3D uAF; // auxiliary fluid | ||
View3D uCR; // conserved radiation | ||
}; | ||
|
||
#endif // STATE_HPP_ |