-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ability to override radial geometry for radialOnly option in ASPH
- Loading branch information
Showing
11 changed files
with
194 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#------------------------------------------------------------------------------- | ||
# ASPHRadialFunctor | ||
#------------------------------------------------------------------------------- | ||
from PYB11Generator import * | ||
|
||
@PYB11template("Dimension") | ||
@PYB11holder("std::shared_ptr") | ||
class ASPHRadialFunctor: | ||
|
||
PYB11typedefs = """ | ||
using Scalar = typename %(Dimension)s::Scalar; | ||
using Vector = typename %(Dimension)s::Vector; | ||
using Tensor = typename %(Dimension)s::Tensor; | ||
using SymTensor = typename %(Dimension)s::SymTensor; | ||
""" | ||
|
||
#........................................................................... | ||
# Constructors | ||
def pyinit(self): | ||
"ASPHRadialFunctor constructor" | ||
|
||
#........................................................................... | ||
# Virtual methods | ||
@PYB11virtual | ||
@PYB11const | ||
def radialUnitVector(self, | ||
nodeListi = "const size_t", | ||
i = "const size_t", | ||
posi = "const Vector&"): | ||
return "Vector" | ||
|
||
@PYB11virtual | ||
@PYB11const | ||
def radialCoordinate(self, | ||
nodeListi = "const size_t", | ||
i = "const size_t", | ||
posi = "const Vector&"): | ||
return "Scalar" |
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,39 @@ | ||
//---------------------------------Spheral++----------------------------------// | ||
// ASPHRadialFunctor | ||
// | ||
// Provides user-overridable hooks to modify how the ASPH object computes | ||
// radial normals and magnitude | ||
// | ||
// Created by JMO, Thu Oct 10 14:12:37 PDT 2024 | ||
//----------------------------------------------------------------------------// | ||
#ifndef __Spheral_ASPHRadialFunctor__ | ||
#define __Spheral_ASPHRadialFunctor__ | ||
|
||
namespace Spheral { | ||
|
||
template<typename Dimension> | ||
class ASPHRadialFunctor { | ||
|
||
public: | ||
//--------------------------- Public Interface ---------------------------// | ||
using Scalar = typename Dimension::Scalar; | ||
using Vector = typename Dimension::Vector; | ||
|
||
// Constructors, destructor. | ||
ASPHRadialFunctor() {} | ||
virtual ~ASPHRadialFunctor() {} | ||
|
||
// Compute the outward pointing radial unit vector | ||
virtual Vector radialUnitVector(const size_t nodeListi, | ||
const size_t i, | ||
const Vector& posi) const { return posi.unitVector(); } | ||
|
||
// Compute the radial coordinate | ||
virtual Scalar radialCoordinate(const size_t nodeListi, | ||
const size_t i, | ||
const Vector& posi) const { return posi.magnitude(); } | ||
}; | ||
|
||
} | ||
|
||
#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
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
Oops, something went wrong.