-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
701 additions
and
139 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
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,61 @@ | ||
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin, | ||
// Northwest Research Associates. Under the terms of Contract DE-NA0003525 | ||
// with NTESS, the U.S. Government retains certain rights in this software. | ||
// | ||
// This software is released under the BSD 3-clause license. See LICENSE file | ||
// for more details. | ||
// | ||
|
||
#ifndef StringTimeCoordFunction_h | ||
#define StringTimeCoordFunction_h | ||
|
||
#include "stk_expreval/Evaluator.hpp" | ||
|
||
#include "Kokkos_Core.hpp" | ||
|
||
#include <string> | ||
|
||
namespace sierra::nalu { | ||
|
||
namespace fcn { | ||
inline constexpr int UNMAPPED_INDEX = -1; | ||
} | ||
|
||
class StringTimeCoordFunction | ||
{ | ||
public: | ||
StringTimeCoordFunction(std::string fcn); | ||
KOKKOS_FUNCTION double | ||
operator()(double t, double x, double y, double z) const; | ||
[[nodiscard]] KOKKOS_FUNCTION bool is_constant() const { return constant; } | ||
|
||
KOKKOS_FUNCTION int spatial_dim() const | ||
{ | ||
if (z_index != fcn::UNMAPPED_INDEX) { | ||
return 3; | ||
} else if (y_index != fcn::UNMAPPED_INDEX) { | ||
return 2; | ||
} else if (x_index != fcn::UNMAPPED_INDEX) { | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
[[nodiscard]] KOKKOS_FUNCTION bool is_spatial() const | ||
{ | ||
return spatial_dim() != 0; | ||
} | ||
|
||
private: | ||
stk::expreval::ParsedEval<> parsed_eval; | ||
bool constant = false; | ||
int t_index = fcn::UNMAPPED_INDEX; | ||
int x_index = fcn::UNMAPPED_INDEX; | ||
int y_index = fcn::UNMAPPED_INDEX; | ||
int z_index = fcn::UNMAPPED_INDEX; | ||
}; | ||
|
||
} // namespace sierra::nalu | ||
|
||
#endif |
41 changes: 41 additions & 0 deletions
41
include/user_functions/StringTimeCoordTemperatureAuxFunction.h
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,41 @@ | ||
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin, | ||
// Northwest Research Associates. Under the terms of Contract DE-NA0003525 | ||
// with NTESS, the U.S. Government retains certain rights in this software. | ||
// | ||
// This software is released under the BSD 3-clause license. See LICENSE file | ||
// for more details. | ||
// | ||
|
||
#ifndef StringTimeCoordTemperatureAuxFunction_h | ||
#define StringTimeCoordTemperatureAuxFunction_h | ||
|
||
#include "AuxFunction.h" | ||
#include "StringTimeCoordFunction.h" | ||
|
||
#include <vector> | ||
|
||
namespace sierra::nalu { | ||
|
||
class StringTimeCoordTemperatureAuxFunction final : public AuxFunction | ||
{ | ||
public: | ||
StringTimeCoordTemperatureAuxFunction(std::string fcn); | ||
|
||
void do_evaluate( | ||
const double* coords, | ||
const double time, | ||
const unsigned spatialDimension, | ||
const unsigned numPoints, | ||
double* fieldPtr, | ||
const unsigned fieldSize, | ||
const unsigned beginPos, | ||
const unsigned endPos) const final; | ||
|
||
private: | ||
const StringTimeCoordFunction f_; | ||
}; | ||
|
||
} // namespace sierra::nalu | ||
|
||
#endif |
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
10 changes: 5 additions & 5 deletions
10
reg_tests/test_files/ablHill3dSymPenalty/ablHill3dSymPenalty.norm.gold
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
1.994475350611083e-05 1 0.02 | ||
1.245775182965687e-05 2 0.04 | ||
4.162417946007383e-06 3 0.06 | ||
1.630724817616641e-07 4 0.08 | ||
1.300056783839082e-08 5 0.1 | ||
0.0001340341715347378 1 0.02 | ||
7.668636308766615e-05 2 0.04 | ||
3.862864631832822e-05 3 0.06 | ||
2.872666841740503e-05 4 0.08 | ||
2.453914784048959e-05 5 0.1 |
Oops, something went wrong.