Skip to content

Commit

Permalink
ugly init but working
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Rovinelli committed May 1, 2020
1 parent 7953024 commit a673ef8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions framework/include/interfaces/Coupleable.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,10 @@ class Coupleable
const VariableGradient & _grad_zero;
const MooseArray<ADRealVectorValue> & _ad_grad_zero;

/// Zero gradient of a test and trail function
const VariablePhiGradient & _grad_phi_zero;
const VariableTestGradient & _grad_test_zero;

/// Zero second derivative of a variable
const VariableSecond & _second_zero;
const MooseArray<ADRealTensorValue> & _ad_second_zero;
Expand Down
2 changes: 2 additions & 0 deletions framework/include/problems/FEProblemBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,8 @@ class FEProblemBase : public SubProblem, public Restartable
std::vector<MooseArray<ADReal>> _ad_zero;
std::vector<VariableGradient> _grad_zero;
std::vector<MooseArray<ADRealVectorValue>> _ad_grad_zero;
std::vector<VariablePhiGradient> _grad_phi_zero;
std::vector<VariableTestGradient> _grad_test_zero;
std::vector<VariableSecond> _second_zero;
std::vector<MooseArray<ADRealTensorValue>> _ad_second_zero;
std::vector<VariablePhiSecond> _second_phi_zero;
Expand Down
2 changes: 2 additions & 0 deletions framework/src/interfaces/Coupleable.C
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Coupleable::Coupleable(const MooseObject * moose_object, bool nodal, bool is_fv)
_ad_zero(_c_fe_problem._ad_zero[_c_tid]),
_grad_zero(_c_fe_problem._grad_zero[_c_tid]),
_ad_grad_zero(_c_fe_problem._ad_grad_zero[_c_tid]),
_grad_phi_zero(_c_fe_problem._grad_phi_zero[_c_tid]),
_grad_test_zero(_c_fe_problem._grad_test_zero[_c_tid]),
_second_zero(_c_fe_problem._second_zero[_c_tid]),
_ad_second_zero(_c_fe_problem._ad_second_zero[_c_tid]),
_second_phi_zero(_c_fe_problem._second_phi_zero[_c_tid]),
Expand Down
8 changes: 8 additions & 0 deletions framework/src/problems/FEProblemBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ FEProblemBase::FEProblemBase(const InputParameters & parameters)
_ad_zero.resize(n_threads);
_grad_zero.resize(n_threads);
_ad_grad_zero.resize(n_threads);
_grad_phi_zero.resize(n_threads);
_grad_test_zero.resize(n_threads);
_second_zero.resize(n_threads);
_ad_second_zero.resize(n_threads);
_second_phi_zero.resize(n_threads);
Expand Down Expand Up @@ -488,6 +490,8 @@ FEProblemBase::~FEProblemBase()
_zero[i].release();
_scalar_zero[i].release();
_grad_zero[i].release();
_grad_phi_zero[i].release();
_grad_test_zero[i].release();
_second_zero[i].release();
_second_phi_zero[i].release();
_vector_zero[i].release();
Expand Down Expand Up @@ -1600,6 +1604,8 @@ FEProblemBase::reinitDirac(const Elem * elem, THREAD_ID tid)
_scalar_zero[tid].resize(FORTYTHIRD, 0);
_zero[tid].resize(max_qpts, 0);
_grad_zero[tid].resize(max_qpts, RealGradient(0.));
_grad_phi_zero[tid].resize(max_qpts, {0., 0., 0.});
_grad_test_zero[tid].resize(max_qpts, {0., 0., 0.});
_second_zero[tid].resize(max_qpts, RealTensor(0.));
_second_phi_zero[tid].resize(
max_qpts, std::vector<RealTensor>(getMaxShapeFunctions(), RealTensor(0.)));
Expand Down Expand Up @@ -4573,6 +4579,8 @@ FEProblemBase::createQRules(QuadratureType type, Order order, Order volume_order
_zero[tid].resize(max_qpts, 0);
_ad_zero[tid].resize(max_qpts, 0);
_grad_zero[tid].resize(max_qpts, RealGradient(0.));
_grad_phi_zero[tid].resize(max_qpts, {0., 0., 0.});
_grad_test_zero[tid].resize(max_qpts, {0., 0., 0.});
_ad_grad_zero[tid].resize(max_qpts, ADRealGradient(0));
_second_zero[tid].resize(max_qpts, RealTensor(0.));
_ad_second_zero[tid].resize(max_qpts, ADRealTensorValue(0));
Expand Down

0 comments on commit a673ef8

Please sign in to comment.