Skip to content

Commit

Permalink
Add subdirectory in Source/Matter and fix GNUmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
AreefW committed Feb 13, 2025
1 parent 41083b0 commit 66a8ab6
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 38 deletions.
6 changes: 5 additions & 1 deletion Examples/ScalarFieldBH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ makefiles += releasedExamples_AMRPoisson_execVariableCoefficient
# cxxcppflags = -DUSE_CTTK
cxxcppflags = -DUSE_CTTKHybrid

# Choose directory of matter type
MatterType = ScalarField

# the base name(s) of the application(s) in this directory
ebase = Main_ScalarFieldBH

Expand All @@ -27,11 +30,12 @@ INPUT = params.txt
src_dirs := ../../Source \
../../Source/Core \
../../Source/Matter \
../../Source/Matter/${MatterType} \
../../Source/Methods \
../../Source/Tools \
../../Source/Variables \
../../Source/TaggingCriteria \
../../Source/Operator \
../../Source/Operator \
../../Source/Operator/SolverOperator

# shared code for building example programs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

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

#ifndef MYMATTERFUNCTIONS_HPP_
#define MYMATTERFUNCTIONS_HPP_
#include "ScalarField.hpp"

Real ScalarField::my_potential_function(const Real &phi_here) const
{
Expand All @@ -28,5 +23,3 @@ 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_ */
6 changes: 5 additions & 1 deletion Examples/ScalarFieldCosmo/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ makefiles += releasedExamples_AMRPoisson_execVariableCoefficient
cxxcppflags = -DUSE_CTTK
# cxxcppflags = -DUSE_CTTKHybrid

# Choose directory of matter type
MatterType = ScalarField

# the base name(s) of the application(s) in this directory
ebase = Main_ScalarFieldCosmo

Expand All @@ -27,11 +30,12 @@ INPUT = params.txt
src_dirs := ../../Source \
../../Source/Core \
../../Source/Matter \
../../Source/Matter/${MatterType} \
../../Source/Methods \
../../Source/Tools \
../../Source/Variables \
../../Source/TaggingCriteria \
../../Source/Operator \
../../Source/Operator \
../../Source/Operator/SolverOperator

# shared code for building example programs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

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

#ifndef MYMATTERFUNCTIONS_HPP_
#define MYMATTERFUNCTIONS_HPP_
#include "ScalarField.hpp"

Real ScalarField::my_potential_function(const Real &phi_here) const
{
Expand All @@ -34,5 +29,3 @@ 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_ */
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

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

#ifndef SCALARFIELD_IMPL_HPP_
#define SCALARFIELD_IMPL_HPP_

#include "ScalarField.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 @@ -72,5 +75,3 @@ emtensor_t ScalarField::compute_emtensor(const IntVect a_iv,

return out;
}

#endif /* SCALARFIELD_IMPL_HPP_ */
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,4 @@ class ScalarField
RealVect domainLength;
};

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

#endif /* SCALARFIELD_HPP_ */
File renamed without changes.
4 changes: 4 additions & 0 deletions Tests/PeriodicScalarFieldTest/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
# trace the chain of included makefiles
makefiles += releasedExamples_AMRPoisson_execVariableCoefficient

# Choose directory of matter type
MatterType = ScalarField

# the base name(s) of the application(s) in this directory
ebase = PeriodicScalarTest

Expand All @@ -21,6 +24,7 @@ INPUT = params.txt
src_dirs := ../../Source \
../../Source/Core \
../../Source/Matter \
../../Source/Matter/${MatterType} \
../../Source/Methods \
../../Source/Tools \
../../Source/Variables \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
* Please refer to LICENSE in GRTresna's root directory.
*/

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

#ifndef MYMATTERFUNCTIONS_HPP_
#define MYMATTERFUNCTIONS_HPP_
#include "ScalarField.hpp"

Real ScalarField::my_potential_function(const Real &phi_here) const
{
Expand All @@ -34,5 +29,3 @@ 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_ */

0 comments on commit 66a8ab6

Please sign in to comment.