Commit 28f2e749 authored by Tobias Weinzierl's avatar Tobias Weinzierl

Adopted signatures

parent a4cc5f19
......@@ -68,17 +68,19 @@ void EulerFV::MyEulerSolver::adjustSolution(const double* const x,const double t
double voxelSize = _maximumMeshSize / PatchSize;
std::vector< delta::ContactPoint > contact =
delta::filter(
delta::contactdetection::filter(
delta::contactdetection::sphereToTriangle(
x[0], // voxel centre
x[1], // voxel centre
x[2], // voxel centre
voxelSize/2.0 * std::sqrt(DIMENSIONS), // bounding sphere around voxel
-1, // there's some indexing stuff which we need to couple the physics
// of two solvers. But we do not need this here
_embeddedGeometry->getNumberOfTriangles(),
_embeddedGeometry->getXCoordinates(),
_embeddedGeometry->getYCoordinates(),
_embeddedGeometry->getZCoordinates(),
_embeddedGeometry->getNumberOfTriangles(),
nullptr, // again, no indices required here
voxelSize * widthOfLayerAroundObject // epsilon
),
voxelSize
......
......@@ -19,8 +19,14 @@
* We use Peano's logging
*/
#include "tarch/logging/Log.h"
/**
* Include Delta
*/
#include "delta/Mesh.h"
namespace EulerFV{
class MyEulerSolver;
}
......@@ -30,8 +36,11 @@ class EulerFV::MyEulerSolver : public EulerFV::AbstractMyEulerSolver {
/**
* Log device
*/
static tarch::logging::Log _log;
static tarch::logging::Log _log;
/**
* We hold one instance of a Delta mesh.
*/
delta::Mesh* _embeddedGeometry;
public:
MyEulerSolver(
......@@ -48,43 +57,60 @@ class EulerFV::MyEulerSolver : public EulerFV::AbstractMyEulerSolver {
void init(const std::vector<std::string>& cmdlineargs,const exahype::parser::ParserView& constants) final override ;
/**
* @see FiniteVolumesSolver
* Adjust the conserved variables and parameters (together: Q) at a given time t at the (quadrature) point x.
*
* @note Please overwrite function adjustSolution(...) if you want to
* adjust the solution degrees of freedom in a cellwise manner.
*
* @param[in] x physical coordinate on the face.
* @param[in] t start of the time interval.
* @param[in] dt width of the time interval.
* @param[in] Q vector of state variables (plus parameters);
* range: [0,nVar+nPar-1], already allocated.
*/
void adjustSolution(const double* const x,const double t,const double dt, double* const Q) override;
/**
* Compute the eigenvalues of the flux tensor per coordinate direction \p d.
* Compute the eigenvalues of the flux tensor per coordinate @p direction.
*
* \param[in] Q the conserved variables associated with a quadrature node
* as C array (already allocated).
* \param[in] d the column of the flux vector (d=0,1,...,DIMENSIONS).
* \param[inout] lambda the eigenvalues as C array (already allocated).
* @param[in] Q vector of state variables (plus parameters);
* range: [0,nVar+nPar-1], already allocated.
* @param[in] direction normal direction of the face / column of the flux vector (range: [0,nDims-1]).
* @param[inout] lambda eigenvalues as C array;
* range: [0,nVar-1], already allocated.
*/
void eigenvalues(const double* const Q,const int d,double* const lambda) override;
void eigenvalues(const double* const Q,const int direction,double* const lambda) override;
/**
* Impose boundary conditions at a point on a boundary face
* within the time interval [t,t+dt].
*
* \param[in] x the physical coordinate on the face.
* \param[in] t the start of the time interval.
* \param[in] dt the width of the time interval.
* \param[in] x physical coordinate on the boundary; range: [0,nDims-1].
* \param[in] t start of the time interval.
* \param[in] dt width of the time interval.
* \param[in] faceIndex indexing of the face (0 -- {x[0]=xmin}, 1 -- {x[1]=xmax}, 2 -- {x[1]=ymin}, 3 -- {x[2]=ymax}, and so on,
* where xmin,xmax,ymin,ymax are the bounds of the cell containing point x.
* \param[in] d the coordinate direction the face normal is pointing to.
* \param[in] QIn the conserved variables at point x from inside of the domain
* and time-averaged (over [t,t+dt]) as C array (already allocated).
* \param[inout] QOut the conserved variables at point x from outside of the domain
* and time-averaged (over [t,t+dt]) as C array (already allocated).
* \param[in] direction coordinate direction the face normal is pointing to.
* @param[in] QIn vector of state variables (plus parameters) from inside of the domain
* range: [0,nVar+nPar-1], already allocated.
* @param[inout] QOut vector of state variables (plus parameters) from outside of the domain.
* range: [0,nVar+nPar-1], already allocated.
*
* @note The argument QOut is initially set as QIn mirrored at the boundary face. This
* makes it easier to implement certain boundary conditions where a velocity, e.g.,
* needs to change its sign compared to the inside state.
*/
void boundaryValues(const double* const x,const double t,const double dt,const int faceIndex,const int normalNonZero,const double* const fluxIn,const double* const stateIn,const double* const gradStateIn,double* const fluxOut,double* const stateOut) override;
void boundaryValues(const double* const x,const double t,const double dt,const int faceIndex,const int direction,const double* const QIn,double* const QOut) override;
/**
* Compute the flux tensor.
*
* \param[in] Q the conserved variables (and parameters) associated with a quadrature point
* as C array (already allocated).
* \param[inout] F the fluxes at that point as C array (already allocated).
* @param[in] Q vector of state variables (plus parameters);
* range: [0,nVar+nPar-1], already allocated.
*
* @param[inout] F flux at that point;
* range[outer->inner]: [0,nDim-1]x[0,nVar-1],
* already allocated.
*/
void flux(const double* const Q,double** const F) override;
......
......@@ -207,7 +207,7 @@ class EulerFV::AbstractMyEulerSolver::ReadOnlyVariables : public EulerFV::Abstra
class EulerFV::AbstractMyEulerSolver::Variables : public EulerFV::AbstractMyEulerSolver::VariableMetrics{
private:
double* _Q;
double* const _Q;
public:
static constexpr int SizeVariables = 6;
static constexpr int SizeParameters = 0;
......@@ -263,7 +263,7 @@ class EulerFV::AbstractMyEulerSolver::Variables : public EulerFV::AbstractMyEule
}
tarch::la::Vector<3,double> j() const {
tarch::la::Vector<3,double> values;
values=_Q[1],_Q[2],_Q[3],_Q[3];
values=_Q[1],_Q[2],_Q[3];
return values;
}
// setters for j
......@@ -292,7 +292,7 @@ class EulerFV::AbstractMyEulerSolver::Variables : public EulerFV::AbstractMyEule
class EulerFV::AbstractMyEulerSolver::Fluxes : public EulerFV::AbstractMyEulerSolver::VariableMetrics {
private:
double** _F;
double** const _F;
public:
Fluxes(double** const F) : _F(F) {}
......@@ -565,4 +565,74 @@ _F[0][1+2],_F[1][1+2],_F[2][1+2];
// NamingSchemes:
//
// Global Observables
//
class EulerFV::AbstractMyEulerSolver::ReadOnlyGlobalObservables {
private:
const double* const _observables;
public:
static constexpr int Size = 0;
ReadOnlyGlobalObservables(const double* const observables) : _observables(observables) {}
double operator [] (int index) const {
assertion(index>=0 && index < Size);
return _observables[index];
}
double operator () (int index) const {
assertion(index>=0 && index < Size);
return _observables[index];
}
const double* data() const {
return _observables;
}
int size() const {
return Size;
}
}; // end of ReadOnlyGlobalObservables
class EulerFV::AbstractMyEulerSolver::GlobalObservables {
private:
double* const _observables;
public:
static constexpr int Size = 0;
GlobalObservables(double* const observables) : _observables(observables) {}
void operator = (GlobalObservables& observables) {
std::copy(observables.data(),observables.data()+Size,_observables);
}
void operator = (ReadOnlyGlobalObservables& observables) {
assertion(observables.size()==Size);
std::copy(observables.data(),observables.data()+Size,_observables);
}
double& operator [] (int index) {
assertion(index>=0 && index < Size);
return _observables[index];
}
double& operator () (int index) {
assertion(index>=0 && index < Size);
return _observables[index];
}
double* data() {
return _observables;
}
int size() const {
return Size;
}
};
// end of GlobalObservables
#endif
\ No newline at end of file
......@@ -23,12 +23,18 @@ Change into the directory Demonstrators/EulerFV-with-Delta and configure your
build. I enlist the requirements below and give examples in brackets if stuff
has to be done manually, i.e. if your system is not configured properly yet.
- Ensure that TBB_INC is set properly
- If you want to use shared memory parallelism (optional):
Ensure that TBB_INC is set properly
(export TBB_INC=-I/opt/intel/tbb/include)
- Ensure that TBB_SHLIB is set properly
- If you want to use shared memory parallelism (optional):
Ensure that TBB_SHLIB is set properly
(export TBB_SHLIB="-L/opt/intel/tbb/lib/intel64/gcc4.7 -ltbb")
Some systems also require -lpthread to be in the variable.
- Ensure the Delta sources path is added to the project's build flags
- If you want to use the GNU compiler (Intel is default):
Set COMPILER variable to GNU
(export COMPILER=GNU)
- Ensure the Delta sources path is added to the project's build flags. The
value of PROJECT_CLFAGS has to point to the directory holding delta/Mesh.h
(export PROJECT_CFLAGS=-I/home/.../git/Delta/src)
- Ensure the Delta library path is added to the project's linker flags
(export PROJECT_LFLAGS=-L/home/.../git/Delta/src/lib -ldelta)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment