timestepping (not working)

This commit is contained in:
dino.celebic 2026-01-24 23:56:16 +01:00
commit 6a2db786c5
3 changed files with 57 additions and 29 deletions

View file

@ -394,6 +394,9 @@ void FEM_Matrix::CalculateLaplace_mult(vector<double> &f)
for (int k = 0; k < _nrows; ++k) {
_sk[k] = 0.0;
}
for (int k = 0; k < _nrows; ++k) {
f[k] = 0.0;
}
double ske[3][3], fe[3];
// Loop over all elements
@ -457,17 +460,17 @@ double FEM_Matrix::VolumetricHeatCapacity(const int subdomain)
switch (subdomain)
{
// ceramic mug
case 1:
case 0:
c = 2.0 * 1e6;
break;
// water
case 2:
case 1:
c = 4.184 * 1e6;
break;
// air
case 3:
case 2:
c = 1.2 * 1e3;
break;
@ -479,7 +482,7 @@ double FEM_Matrix::VolumetricHeatCapacity(const int subdomain)
return c;
}
void FEM_Matrix::AddMass_mult(vector<double> &f)
void FEM_Matrix::AddMass_mult(vector<double> &f, const double scale_factor)
{
cout << "\n############ FEM_Matrix::AddMass_mult ";
double tstart = omp_get_wtime(); // OpenMP
@ -503,7 +506,7 @@ void FEM_Matrix::AddMass_mult(vector<double> &f)
//cout << subdomain << endl;
CalcElem_MasseSpecific(ia.data() + 3 * i, xc.data(), c, ske);
CalcElem_MasseSpecific(ia.data() + 3 * i, xc.data(), c * scale_factor, ske);
//AddElem(ia.data()+3 * i, ske, fe, _id.data(), _ik.data(), _sk.data(), f.data()); // GH: deprecated
AddElem_3(ia.data() + 3 * i, ske, fe, f);
}