Skip to content

Commit

Permalink
[98] generated code update
Browse files Browse the repository at this point in the history
Generation of new generated code.

Bug: cea-hpc#98
Signed-off-by: Vincent Blain <vincent.blain@obeosoft.com>
  • Loading branch information
vblainobeo committed Oct 7, 2022
1 parent cc40a24 commit 87518d1
Show file tree
Hide file tree
Showing 142 changed files with 819 additions and 819 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void ExplicitHeatEquationModule::init()
// initialization of other attributes
m_lastDump = numeric_limits<int>::min();
m_n = 0;
m_deltat = 0.001;
m_delta_t = 0.001;
m_alpha.resize(nbCell());

// calling jobs
Expand Down Expand Up @@ -144,12 +144,12 @@ void ExplicitHeatEquationModule::computeFaceLength()

/**
* Job computeTn called @1.0 in executeTimeLoopN method.
* In variables: deltat, t_n
* In variables: delta_t, t_n
* Out variables: t_nplus1
*/
void ExplicitHeatEquationModule::computeTn()
{
m_t_nplus1 = m_t_n + m_deltat;
m_t_nplus1 = m_t_n + m_delta_t;
}

/**
Expand Down Expand Up @@ -267,7 +267,7 @@ void ExplicitHeatEquationModule::updateU()
/**
* Job computeDeltaTn called @2.0 in simulate method.
* In variables: D, V
* Out variables: deltat
* Out variables: delta_t
*/
void ExplicitHeatEquationModule::computeDeltaTn()
{
Expand All @@ -283,8 +283,8 @@ void ExplicitHeatEquationModule::computeDeltaTn()
};
reduction0 = reducer.reduce();
}
m_deltat = reduction0 * 0.24;
m_global_deltat = m_deltat;
m_delta_t = reduction0 * 0.24;
m_global_deltat = m_delta_t;
}

/**
Expand Down Expand Up @@ -359,13 +359,13 @@ void ExplicitHeatEquationModule::setUpTimeLoopN()

/**
* Job computeAlphaCoeff called @3.0 in simulate method.
* In variables: V, Xc, deltat, faceConductivity, faceLength
* In variables: V, Xc, delta_t, faceConductivity, faceLength
* Out variables: alpha
*/
void ExplicitHeatEquationModule::computeAlphaCoeff()
{
auto command = makeCommand(m_default_queue);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_V = ax::viewIn(command, m_V);
auto in_faceLength = ax::viewIn(command, m_faceLength);
auto in_faceConductivity = ax::viewIn(command, m_faceConductivity);
Expand All @@ -374,7 +374,7 @@ void ExplicitHeatEquationModule::computeAlphaCoeff()
command << RUNCOMMAND_ENUMERATE(Cell, cCells, allCells())
{
const auto cId(cCells);
Real alphaDiag(0.0);
Real alpha_Diag(0.0);
{
const auto neighbourCellsC(m_mesh->getNeighbourCells(cId));
const Int32 nbNeighbourCellsC(neighbourCellsC.size());
Expand All @@ -384,12 +384,12 @@ void ExplicitHeatEquationModule::computeAlphaCoeff()
const auto dCells(dId);
const auto fId(m_mesh->getCommonFace(cId, dId));
const auto fFaces(fId);
const Real alphaExtraDiag(in_deltat / in_V[cCells] * (in_faceLength[fFaces] * in_faceConductivity[fFaces]) / explicitheatequationfreefuncs::norm(explicitheatequationfreefuncs::operatorSub(in_Xc[cCells], in_Xc[dCells])));
out_alpha[cCells][dCells] = alphaExtraDiag;
alphaDiag = alphaDiag + alphaExtraDiag;
const Real alpha_ExtraDiag(in_delta_t / in_V[cCells] * (in_faceLength[fFaces] * in_faceConductivity[fFaces]) / explicitheatequationfreefuncs::norm(explicitheatequationfreefuncs::operatorSub(in_Xc[cCells], in_Xc[dCells])));
out_alpha[cCells][dCells] = alpha_ExtraDiag;
alpha_Diag = alpha_Diag + alpha_ExtraDiag;
}
}
out_alpha[cCells][cCells] = 1 - alphaDiag;
out_alpha[cCells][cCells] = 1 - alpha_Diag;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ExplicitHeatEquationModule
Int32 m_n;
static constexpr Real m_u0 = 1.0;
static constexpr Real2 m_vectOne = {1.0, 1.0};
Real m_deltat;
Real m_delta_t;
Real m_t_n;
Real m_t_nplus1;
Real m_t_n0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
need-sync="true"/>

<variable
field-name="deltatj"
name="deltatj"
field-name="delta_tj"
name="delta_tj"
data-type="real"
item-kind="cell"
dim="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,17 @@ void Glace2dModule::computeV()

/**
* Job initialize called @2.0 in simulate method.
* In variables: Cjr_ic, X_n0, gamma, pIniZd, pIniZg, rhoIniZd, rhoIniZg, xInterface
* In variables: Cjr_ic, X_n0, gamma, pIniZd, pIniZg, rho_IniZd, rho_IniZg, xInterface
* Out variables: E_n, m, p, rho, uj_n
*/
void Glace2dModule::initialize()
{
auto command = makeCommand(m_default_queue);
auto in_X_n0 = ax::viewIn(command, m_X_n0);
auto in_xInterface = m_xInterface;
auto in_rhoIniZg = m_rhoIniZg;
auto in_rho_IniZg = m_rho_IniZg;
auto in_pIniZg = m_pIniZg;
auto in_rhoIniZd = m_rhoIniZd;
auto in_rho_IniZd = m_rho_IniZd;
auto in_pIniZd = m_pIniZd;
auto in_Cjr_ic = ax::viewIn(command, m_Cjr_ic);
auto in_gamma = m_gamma;
Expand Down Expand Up @@ -406,12 +406,12 @@ void Glace2dModule::initialize()
const Real2 center(glace2dfreefuncs::operatorMult(0.25, reduction0));
if (center[0] < in_xInterface)
{
rho_ic = in_rhoIniZg;
rho_ic = in_rho_IniZg;
p_ic = in_pIniZg;
}
else
{
rho_ic = in_rhoIniZd;
rho_ic = in_rho_IniZd;
p_ic = in_pIniZd;
}
Real reduction1(0.0);
Expand Down Expand Up @@ -611,15 +611,15 @@ void Glace2dModule::computeAjr()
/**
* Job computedeltatj called @6.0 in executeTimeLoopN method.
* In variables: V, c, l
* Out variables: deltatj
* Out variables: delta_tj
*/
void Glace2dModule::computedeltatj()
{
auto command = makeCommand(m_default_queue);
auto in_l = ax::viewIn(command, m_l);
auto in_V = ax::viewIn(command, m_V);
auto in_c = ax::viewIn(command, m_c);
auto out_deltatj = ax::viewOut(command, m_deltatj);
auto out_delta_tj = ax::viewOut(command, m_delta_tj);
command << RUNCOMMAND_ENUMERATE(Cell, jCells, allCells())
{
const auto jId(jCells);
Expand All @@ -632,7 +632,7 @@ void Glace2dModule::computedeltatj()
reduction0 = glace2dfreefuncs::sumR0(reduction0, in_l[jCells][rNodesOfCellJ]);
}
}
out_deltatj[jCells] = 2.0 * in_V[jCells] / (in_c[jCells] * reduction0);
out_delta_tj[jCells] = 2.0 * in_V[jCells] / (in_c[jCells] * reduction0);
};
}

Expand Down Expand Up @@ -708,24 +708,24 @@ void Glace2dModule::computeBr()

/**
* Job computeDt called @7.0 in executeTimeLoopN method.
* In variables: deltatCfl, deltatj, stopTime, t_n
* Out variables: deltat
* In variables: delta_tCfl, delta_tj, stopTime, t_n
* Out variables: delta_t
*/
void Glace2dModule::computeDt()
{
Real reduction0(numeric_limits<double>::max());
{
auto command = makeCommand(m_default_queue);
auto in_deltatj = ax::viewIn(command, m_deltatj);
auto in_delta_tj = ax::viewIn(command, m_delta_tj);
ax::ReducerMin<Real> reducer(command);
command << RUNCOMMAND_ENUMERATE(Cell, jCells, allCells())
{
reducer.min(in_deltatj[jCells]);
reducer.min(in_delta_tj[jCells]);
};
reduction0 = reducer.reduce();
}
m_deltat = std::min((m_deltatCfl * reduction0), (options()->stopTime() - m_t_n));
m_global_deltat = m_deltat;
m_delta_t = std::min((m_delta_tCfl * reduction0), (options()->stopTime() - m_t_n));
m_global_deltat = m_delta_t;
}

/**
Expand Down Expand Up @@ -855,12 +855,12 @@ void Glace2dModule::computeMt()

/**
* Job computeTn called @8.0 in executeTimeLoopN method.
* In variables: deltat, t_n
* In variables: delta_t, t_n
* Out variables: t_nplus1
*/
void Glace2dModule::computeTn()
{
m_t_nplus1 = m_t_n + m_deltat;
m_t_nplus1 = m_t_n + m_delta_t;
}

/**
Expand Down Expand Up @@ -912,25 +912,25 @@ void Glace2dModule::computeFjr()

/**
* Job computeXn called @10.0 in executeTimeLoopN method.
* In variables: X_n, deltat, ur
* In variables: X_n, delta_t, ur
* Out variables: X_nplus1
*/
void Glace2dModule::computeXn()
{
auto command = makeCommand(m_default_queue);
auto in_X_n = ax::viewIn(command, m_X_n);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_ur = ax::viewIn(command, m_ur);
auto out_X_nplus1 = ax::viewOut(command, m_X_nplus1);
command << RUNCOMMAND_ENUMERATE(Node, rNodes, allNodes())
{
out_X_nplus1[rNodes] = glace2dfreefuncs::operatorAdd(in_X_n[rNodes], glace2dfreefuncs::operatorMult(in_deltat, in_ur[rNodes]));
out_X_nplus1[rNodes] = glace2dfreefuncs::operatorAdd(in_X_n[rNodes], glace2dfreefuncs::operatorMult(in_delta_t, in_ur[rNodes]));
};
}

/**
* Job computeEn called @11.0 in executeTimeLoopN method.
* In variables: E_n, F, deltat, m, ur
* In variables: E_n, F, delta_t, m, ur
* Out variables: E_nplus1
*/
void Glace2dModule::computeEn()
Expand All @@ -939,7 +939,7 @@ void Glace2dModule::computeEn()
auto in_F = ax::viewIn(command, m_F);
auto in_ur = ax::viewIn(command, m_ur);
auto in_E_n = ax::viewIn(command, m_E_n);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_m = ax::viewIn(command, m_m);
auto out_E_nplus1 = ax::viewOut(command, m_E_nplus1);
command << RUNCOMMAND_ENUMERATE(Cell, jCells, allCells())
Expand All @@ -956,21 +956,21 @@ void Glace2dModule::computeEn()
reduction0 = glace2dfreefuncs::sumR0(reduction0, glace2dfreefuncs::dot(in_F[jCells][rNodesOfCellJ], in_ur[rNodes]));
}
}
out_E_nplus1[jCells] = in_E_n[jCells] - (in_deltat / in_m[jCells]) * reduction0;
out_E_nplus1[jCells] = in_E_n[jCells] - (in_delta_t / in_m[jCells]) * reduction0;
};
}

/**
* Job computeUn called @11.0 in executeTimeLoopN method.
* In variables: F, deltat, m, uj_n
* In variables: F, delta_t, m, uj_n
* Out variables: uj_nplus1
*/
void Glace2dModule::computeUn()
{
auto command = makeCommand(m_default_queue);
auto in_F = ax::viewIn(command, m_F);
auto in_uj_n = ax::viewIn(command, m_uj_n);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_m = ax::viewIn(command, m_m);
auto out_uj_nplus1 = ax::viewOut(command, m_uj_nplus1);
command << RUNCOMMAND_ENUMERATE(Cell, jCells, allCells())
Expand All @@ -985,7 +985,7 @@ void Glace2dModule::computeUn()
reduction0 = glace2dfreefuncs::sumR1(reduction0, in_F[jCells][rNodesOfCellJ]);
}
}
out_uj_nplus1[jCells] = glace2dfreefuncs::operatorSub(in_uj_n[jCells], glace2dfreefuncs::operatorMult((in_deltat / in_m[jCells]), reduction0));
out_uj_nplus1[jCells] = glace2dfreefuncs::operatorSub(in_uj_n[jCells], glace2dfreefuncs::operatorMult((in_delta_t / in_m[jCells]), reduction0));
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ class Glace2dModule
Int32 m_n;
static constexpr Real m_gamma = 1.4;
static constexpr Real m_xInterface = 0.5;
static constexpr Real m_deltatCfl = 0.4;
static constexpr Real m_rhoIniZg = 1.0;
static constexpr Real m_rhoIniZd = 0.125;
static constexpr Real m_delta_tCfl = 0.4;
static constexpr Real m_rho_IniZg = 1.0;
static constexpr Real m_rho_IniZd = 0.125;
static constexpr Real m_pIniZg = 1.0;
static constexpr Real m_pIniZd = 0.1;
Real m_t_n;
Real m_t_nplus1;
Real m_t_n0;
Real m_deltat;
Real m_delta_t;

// accelerator queue
ax::RunQueue* m_default_queue = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void HeatEquationModule::init()
m_n = 0;

// constant time step
m_global_deltat = m_deltat;
m_global_deltat = m_delta_t;

// calling jobs
computeSurface(); // @1.0
Expand All @@ -102,7 +102,7 @@ void HeatEquationModule::init()

/**
* Job computeOutgoingFlux called @1.0 in executeTimeLoopN method.
* In variables: V, center, deltat, surface, u_n
* In variables: V, center, delta_t, surface, u_n
* Out variables: outgoingFlux
*/
void HeatEquationModule::computeOutgoingFlux()
Expand All @@ -111,7 +111,7 @@ void HeatEquationModule::computeOutgoingFlux()
auto in_u_n = ax::viewIn(command, m_u_n);
auto in_center = ax::viewIn(command, m_center);
auto in_surface = ax::viewIn(command, m_surface);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_V = ax::viewIn(command, m_V);
auto out_outgoingFlux = ax::viewOut(command, m_outgoingFlux);
command << RUNCOMMAND_ENUMERATE(Cell, j1Cells, allCells())
Expand All @@ -131,7 +131,7 @@ void HeatEquationModule::computeOutgoingFlux()
reduction0 = heatequationfreefuncs::sumR0(reduction0, reduction1);
}
}
out_outgoingFlux[j1Cells] = in_deltat / in_V[j1Cells] * reduction0;
out_outgoingFlux[j1Cells] = in_delta_t / in_V[j1Cells] * reduction0;
};
}

Expand Down Expand Up @@ -167,12 +167,12 @@ void HeatEquationModule::computeSurface()

/**
* Job computeTn called @1.0 in executeTimeLoopN method.
* In variables: deltat, t_n
* In variables: delta_t, t_n
* Out variables: t_nplus1
*/
void HeatEquationModule::computeTn()
{
m_t_nplus1 = m_t_n + m_deltat;
m_t_nplus1 = m_t_n + m_delta_t;
}

/**
Expand Down Expand Up @@ -260,20 +260,20 @@ void HeatEquationModule::iniTime()

/**
* Job computeUn called @2.0 in executeTimeLoopN method.
* In variables: deltat, f, outgoingFlux, u_n
* In variables: delta_t, f, outgoingFlux, u_n
* Out variables: u_nplus1
*/
void HeatEquationModule::computeUn()
{
auto command = makeCommand(m_default_queue);
auto in_f = ax::viewIn(command, m_f);
auto in_deltat = m_deltat;
auto in_delta_t = m_delta_t;
auto in_u_n = ax::viewIn(command, m_u_n);
auto in_outgoingFlux = ax::viewIn(command, m_outgoingFlux);
auto out_u_nplus1 = ax::viewOut(command, m_u_nplus1);
command << RUNCOMMAND_ENUMERATE(Cell, jCells, allCells())
{
out_u_nplus1[jCells] = in_f[jCells] * in_deltat + in_u_n[jCells] + in_outgoingFlux[jCells];
out_u_nplus1[jCells] = in_f[jCells] * in_delta_t + in_u_n[jCells] + in_outgoingFlux[jCells];
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class HeatEquationModule
Int32 m_n;
static constexpr Real m_PI = 3.1415926;
static constexpr Real m_alpha = 1.0;
static constexpr Real m_deltat = 0.001;
static constexpr Real m_delta_t = 0.001;
Real m_t_n;
Real m_t_nplus1;
Real m_t_n0;
Expand Down
Loading

0 comments on commit 87518d1

Please sign in to comment.