Skip to content

Commit

Permalink
Change ScalarField.cpp to ScalarField.impl.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
AreefW committed Feb 13, 2025
1 parent d47f305 commit 8c46e1b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

#include "ScalarField.hpp"
#if !defined(SCALARFIELD_HPP_)
#error "This file should only be included through ScalarField.hpp"
#endif

#ifndef MYMATTERFUNCTIONS_HPP_
#define MYMATTERFUNCTIONS_HPP_

Real ScalarField::my_potential_function(const Real &phi_here) const
{
Expand All @@ -23,3 +28,5 @@ Real ScalarField::my_Pi_function(const RealVect &loc) const
return m_matter_params.pi_0 +
m_matter_params.dpi * exp(-rr / m_matter_params.dpi_length);
}

#endif /* MYMATTERFUNCTIONS_HPP_ */
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

#include "ScalarField.hpp"
#if !defined(SCALARFIELD_HPP_)
#error "This file should only be included through ScalarField.hpp"
#endif

#ifndef MYMATTERFUNCTIONS_HPP_
#define MYMATTERFUNCTIONS_HPP_

Real ScalarField::my_potential_function(const Real &phi_here) const
{
Expand All @@ -29,3 +34,5 @@ Real ScalarField::my_Pi_function(const RealVect &loc) const
sin(2 * M_PI * loc[2] / L));
return m_matter_params.pi_0 + dpi_value;
}

#endif /* MYMATTERFUNCTIONS_HPP_ */
3 changes: 3 additions & 0 deletions Source/Matter/ScalarField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ class ScalarField
RealVect domainLength;
};

#include "MyMatterFunctions.hpp"
#include "ScalarField.impl.hpp"

#endif /* SCALARFIELD_HPP_ */
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

#include "ScalarField.hpp"
#if !defined(SCALARFIELD_HPP_)
#error "This file should only be included through ScalarField.hpp"
#endif

#ifndef SCALARFIELD_IMPL_HPP_
#define SCALARFIELD_IMPL_HPP_

#include "DerivativeOperators.hpp"
#include "EMTensor.hpp"
#include "FArrayBox.H"
#include "GRParmParse.hpp"
#include "Grids.hpp"
#include "IntVect.H"
#include "LevelData.H"
#include "MultigridVariables.hpp"
#include "PsiAndAijFunctions.hpp"
#include "REAL.H"
#include "RealVect.H"
#include "Tensor.hpp"

void ScalarField::initialise_matter_vars(LevelData<FArrayBox> &a_multigrid_vars,
const RealVect &a_dx) const
Expand Down Expand Up @@ -75,3 +72,5 @@ emtensor_t ScalarField::compute_emtensor(const IntVect a_iv,

return out;
}

#endif /* SCALARFIELD_IMPL_HPP_ */

0 comments on commit 8c46e1b

Please sign in to comment.