Skip to content

Commit

Permalink
Was overriding inElement in LinearHeatIntegrator,
Browse files Browse the repository at this point in the history
which no longer jives with the way we construct
the FEAstep. Also, eliminated the repeated mistake
in atPoint that references the shape functions, not
the nodal values, and hadn't been incrementing the
RHS fe.
  • Loading branch information
maxrpi committed May 29, 2024
1 parent dd5a09f commit 0df09f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/mumfim/macroscale/LinearHeatIntegrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace mumfim
;
}

/*
void LinearHeatIntegrator::inElement(apf::MeshElement *me)
{
e = apf::createElement(T_, me);
Expand All @@ -56,6 +57,7 @@ namespace mumfim
fe.setSize(nenodes);
fe.zero();
}
*/

void LinearHeatIntegrator::atPoint(apf::Vector3 const &p, double w, double dV)
{
Expand All @@ -73,7 +75,7 @@ namespace mumfim
B(0, i) = BT(i, 0) = Ba[i][0];
B(1, i) = BT(i, 1) = Ba[i][1];
B(2, i) = BT(i, 2) = Ba[i][2];
Theta(i) = field_values_[i] * Na[i];
Theta(i) = field_values_[i];
}

apf::DynamicMatrix BT_D_B(nenodes,nenodes);
Expand All @@ -85,6 +87,8 @@ namespace mumfim
Ke += BT_D_B; // Accumulate over integration points
// fe holds the residual vector, because of the incremental formulation
// In the case of heat sources the residual will be Ke*theta - rhs
apf::multiply(Ke, Theta, fe);
apf::DynamicVector fe_ip(nedofs);
apf::multiply(Ke, Theta, fe_ip);
fe -= fe_ip;
}
}
2 changes: 1 addition & 1 deletion src/mumfim/macroscale/LinearHeatIntegrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace mumfim{
public:
LinearHeatIntegrator(apf::Field *T, apf::Numbering* numbering, apf::Field * K);
LinearHeatIntegrator(apf::Field *T, apf::Numbering* numbering, apf::Matrix3x3 * K_r); // Piecewise constant Kappa
void inElement(apf::MeshElement *me);
//void inElement(apf::MeshElement *me);
bool includesBodyForces() final { return true; }
void atPoint(apf::Vector3 const &p,
double w, double dV);
Expand Down

0 comments on commit 0df09f1

Please sign in to comment.