Commit fde749db authored by Francesco Fambri's avatar Francesco Fambri

Merge branch 'master' of gitlab.lrz.de:exahype/ExaHyPE-Engine

parents 1ea2b07c 9d81b4dc
......@@ -97,9 +97,9 @@ void FOCCZ4::FOCCZ4Solver_ADERDG::boundaryValues(const double* const x,const dou
std::memset(stateOut, 0, nVar * sizeof(double));
std::memset(fluxOut , 0, nVar * sizeof(double));
std::copy_n(stateIn,nVar,stateOut);
std::copy_n(fluxIn,nVar,fluxOut);
/*for(int dd=0; dd<nDim; dd++) F[dd] = Fs[dd];
//std::copy_n(stateIn,nVar,stateOut);
//std::copy_n(fluxIn,nVar,fluxOut);
for(int dd=0; dd<nDim; dd++) F[dd] = Fs[dd];
for(int i=0; i < basisSize; i++) { // i == time
const double weight = kernels::legendre::weights[order][i];
......@@ -111,14 +111,105 @@ void FOCCZ4::FOCCZ4Solver_ADERDG::boundaryValues(const double* const x,const dou
flux(Qgp, F);
for(int m=0; m < nVar; m++) {
stateOut[m] += weight * Qgp[m];
//fluxOut[m] += weight * Fs[direction][m];
fluxOut[m] += weight * Fs[direction][m];
}
}*/
}
}
exahype::solvers::Solver::RefinementControl FOCCZ4::FOCCZ4Solver_ADERDG::refinementCriterion(const double* const luh,const tarch::la::Vector<DIMENSIONS,double>& cellCentre,const tarch::la::Vector<DIMENSIONS,double>& cellSize,double t,const int level) {
// @todo Please implement/augment if required
return exahype::solvers::Solver::RefinementControl::Keep;
//return exahype::solvers::Solver::RefinementControl::Keep;
/*if(DIMENSIONS == 2){
if(std::abs(cellCentre[0]) < 10){
if(std::abs(cellCentre[1]) < 10){
return exahype::solvers::Solver::RefinementControl::Refine;
}
}
}else{
if(std::abs(cellCentre[0]) < 5){
if(std::abs(cellCentre[1]) < 5){
if(std::abs(cellCentre[2]) < 5){
return exahype::solvers::Solver::RefinementControl::Refine;
}
}
}
};
//return exahype::solvers::Solver::RefinementControl::Keep;
if ( level > getCoarsestMeshLevel() ) {
return exahype::solvers::Solver::RefinementControl::Erase;
}
return exahype::solvers::Solver::RefinementControl::Keep;*/
const int nVar = FOCCZ4::AbstractFOCCZ4Solver_ADERDG::NumberOfVariables;
const int order = FOCCZ4::AbstractFOCCZ4Solver_ADERDG::Order;
const int basisSize = order + 1;
int refine_flag;
double max_luh[nVar];
double min_luh[nVar];
//return exahype::solvers::Solver::RefinementControl::Keep;
//
for(int m = 0; m <nVar ; m++){
max_luh[m]=-1.e+14;
min_luh[m]=1.e+14;
}
#if DIMENSIONS==3
kernels::idx4 id_xyz_dof(basisSize,basisSize,basisSize,nVar);
#else
kernels::idx3 id_xy_dof(basisSize,basisSize,nVar);
#endif
for(int i = 0; i < basisSize; i++){
for(int j = 0; j <basisSize ; j++){
#if DIMENSIONS==3
for(int k = 0; k <basisSize ; k++){
#endif
#if DIMENSIONS==3
for(int m = 0; m <nVar ; m++){
if(luh[id_xyz_dof(i,j,k,m)]<min_luh[m]){
min_luh[m]=luh[id_xyz_dof(i,j,k,m)];
}
if(luh[id_xyz_dof(i,j,k,m)]>max_luh[m]){
max_luh[m]=luh[id_xyz_dof(i,j,k,m)];
}
}
#else
for(int m = 0; m <nVar ; m++){
if(luh[id_xy_dof(i,j,m)]<min_luh[m]){
min_luh[m]=luh[id_xy_dof(i,j,m)];
}
if(luh[id_xy_dof(i,j,m)]>max_luh[m]){
max_luh[m]=luh[id_xy_dof(i,j,m)];
}
}
#endif
#if DIMENSIONS==3
}
#endif
}
}
pderefinecriteria_(&refine_flag,&max_luh[0],&min_luh[0],&cellCentre[0]);
if(refine_flag>1){
return exahype::solvers::Solver::RefinementControl::Refine;
}else{
if(refine_flag>0){
return exahype::solvers::Solver::RefinementControl::Keep;
}else{
//return exahype::solvers::Solver::RefinementControl::Recoarse;
return exahype::solvers::Solver::RefinementControl::Keep;
};
}
}
//*****************************************************************************
......@@ -212,6 +303,11 @@ bool FOCCZ4::FOCCZ4Solver_ADERDG::isPhysicallyAdmissible(
return ret_value;
}
void FOCCZ4::FOCCZ4Solver_ADERDG::fusedSource(const double* const restrict Q, const double* const restrict gradQ, double* const restrict S){
//static tarch::multicore::BooleanSemaphore initializationSemaphoreDG;
//tarch::multicore::Lock lock(initializationSemaphoreDG);
pdefusedsrcncp_(S,Q,gradQ);
//fusedSource(Q, gradQ, S);
//lock.free();
}
......@@ -2591,11 +2591,12 @@ RECURSIVE SUBROUTINE PDEFusedSrcNCP(Src_BgradQ,Q,gradQin)
Christoffel_kind1(i,j,k) = DD(k,i,j)+DD(j,i,k)-DD(i,j,k) ! this definition seems to work !
DO l = 1, 3
Christoffel_tilde(i,j,k) = Christoffel_tilde(i,j,k) + g_contr(k,l)*( DD(i,j,l)+DD(j,i,l)-DD(l,i,j) )
mytmp1(i,j,k,l) = DD(i,j,l)+DD(j,i,l)-DD(l,i,j)
Christoffel(i,j,k) = Christoffel(i,j,k) + g_contr(k,l)*( mytmp1(i,j,k,l) )
mytmp2(i,j,k,l)=( g_cov(j,l)*PP(i)+g_cov(i,l)*PP(j)-g_cov(i,j)*PP(l) )
Christoffel(i,j,k) = Christoffel(i,j,k) -g_contr(k,l)*mytmp2(i,j,k,l)
!mytmp1(i,j,k,l) = DD(i,j,l)+DD(j,i,l)-DD(l,i,j)
!Christoffel(i,j,k) = Christoffel(i,j,k) + g_contr(k,l)*( mytmp1(i,j,k,l) )
!mytmp2(i,j,k,l)=( g_cov(j,l)*PP(i)+g_cov(i,l)*PP(j)-g_cov(i,j)*PP(l) )
!Christoffel(i,j,k) = Christoffel(i,j,k) -g_contr(k,l)*mytmp2(i,j,k,l)
!Gtilde(i) = Gtilde(i)+2*g_contr(i,j)*g_contr(k,l)*DD(l,j,k)
Christoffel(i,j,k) = Christoffel(i,j,k) + g_contr(k,l)*(DD(i,j,l)+DD(j,i,l)-DD(l,i,j))-g_contr(k,l)*( g_cov(j,l)*PP(i)+g_cov(i,l)*PP(j)-g_cov(i,j)*PP(l) )
!PRINT *, Christoffel(i,j,k) ,I,J,K
ENDDO
ENDDO
......@@ -4013,4 +4014,30 @@ RECURSIVE SUBROUTINE PDEFusedSrcNCP(Src_BgradQ,Q,gradQin)
!
END SUBROUTINE PDEFusedSrcNCP
RECURSIVE SUBROUTINE pderefinecriteria(refine_flag, max_luh,min_luh,x)
USE MainVariables, ONLY: nVar , nDim
IMPLICIT NONE
Integer, intent(out) :: refine_flag
real, intent(in) :: max_luh(nVar),min_luh(nVar),x(nDim)
!if(abs(x(1))<10) then
! refine_flag=2
! return
!end if
!if(abs(x(2))<15) then
! refine_flag=2
! return
!end if
#ifdef CCZ4EINSTEIN
if(abs(max_luh(60)-min_luh(60))>1.e-4 .or. abs(max_luh(54)-min_luh(54))>1.e-4) then
refine_flag=2
else
refine_flag=0
end if
#endif
END SUBROUTINE pderefinecriteria
#endif
\ No newline at end of file
......@@ -24,6 +24,8 @@ void registerinitialdata_(const char* const id_name, int* id_name_len);
void pdeauxvar_(double* aux, const double* const Q,double* x, const double* const time);
void pdecritialstress_(double* CS, const double* const Q);
void pderefinecriteria_(int* refine_flag,const double* max_luh,const double* min_luh,const double* x);
//void hllemfluxfv_(double* FL, double* FR, const double* const QL, const double* const QR, const double* const QavL, const double* const QavR, const int* normalNonZeroIndex);
void hllemfluxfv_(double* FL, double* FR, const double* const QL, const double* const QR, const int* normalNonZeroIndex);
void hllemriemannsolver_(const int* basisSize, const int* normalNonZeroIndex, double* FL, double* FR, const double* const QL, const double* const QR, const double* const QavL, const double* const QavR);
......
......@@ -7,17 +7,17 @@
"output_directory": "./ApplicationExamples/FOCCZ4/FOCCZ4",
"log_file": "whatever.log"
},
"architecture": "skx",
"architecture": "noarch",
"computational_domain": {
"dimension": 2,
"end_time": 3.0,
"end_time": 101.0,
"offset": [
-20.0,
-20.0
-100.0,
-100.0
],
"width": [
40.0,
40.0
200.0,
200.0
]
},
"shared_memory": {
......@@ -51,8 +51,8 @@
{
"type": "Limiting-ADER-DG",
"name": "FOCCZ4Solver",
"order": 3,
"maximum_mesh_size": 1.0,
"order": 4,
"maximum_mesh_size": 10.0,
"maximum_mesh_depth": 2,
"time_stepping": "global",
"aderdg_kernel": {
......@@ -68,7 +68,7 @@
"fusedsource"
],
"optimised_kernel_debugging": [],
"implementation": "optimised"
"implementation": "generic"
},
"point_sources": 0,
"limiter": {
......
......@@ -10,7 +10,7 @@
"architecture": "generic",
"computational_domain": {
"dimension": 3,
"end_time": 3.0,
"end_time": 11.0,
"offset": [
-20.0,
-20.0,
......
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