Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue solving with more than one time independent variable #166

Closed
pbrewick opened this issue Jul 15, 2020 · 1 comment · Fixed by #241
Closed

Issue solving with more than one time independent variable #166

pbrewick opened this issue Jul 15, 2020 · 1 comment · Fixed by #241

Comments

@pbrewick
Copy link

I have been using the new corrosion app. I tried to introduce displacement as a time independent variable, but I consistently get a strange error once the solve begins, shown here:

`solving...

wall time: 3.171e-06s
field 'mu' [auxiliary solve]: current solution: 5.319559e-01, current residual:1.918105e-14
field 'mupsi' [auxiliary solve]: current solution: 5.319559e-01, current residual:1.918105e-14
field 'Phi' [nonlinear solve]: current solution: 0.000000e+00, current residual:0.000000e+00
field 'Phi' [linear solve]: initial residual:0.000000e+00, current residual:0.000000e+00, nsteps:0, tolerance criterion:1.000000e-06, solution: 0.000000e+00, dU: 0.000000e+00
Relative difference between nonlinear iterations: 0 0 0
field 'irxn' [auxiliary solve]: current solution: 1.523358e+06, current residual:5.800746e-07
Relative difference between nonlinear iterations: 1.52336e+06 0 0
field ' u' [linear solve]: initial residual:1.156921e-10, current residual:1.156921e-10, nsteps:0, tolerance criterion:5.000000e-03, solution: 4.242641e-06, dU: 0.000000e+00
field 'Phi' [nonlinear solve]: current solution: 0.000000e+00, current residual:2.547818e-02


An error occurred in line <4322> of file </p/home/pbrewick/project/deal.ii-9.0.1/include/deal.II/matrix_free/fe_evaluation.h> in function
dealii::Tensor<1, n_components_, dealii::Tensor<1, dim, dealii::VectorizedArray > > dealii::FEEvaluationBase<dim, n_components_, Number, is_face>::get_gradient(unsigned int) const [with int dim = 2; int n_components_ = 2; Number = double; bool is_face = false]
The violated condition was:
this->gradients_quad_initialized==true
Additional information:
(none)`

You can see that the solve has already begun and that, at least initially, the code is able to solve for “u.” I spent some time searching through the PRISMS-PF users forum, but could not find any instances of the same error; and a further on-line search did not turn up any potential remedies, either.

Interestingly, if I remove the potential (Phi) as a field variable and only include displacement (u), the app works fine; the converse is also obviously true -- one can run the corrosion app as-is with just Phi. Thus, it appears as though the issue is related to having two (2) time independent variables. As the code this pertains to is related to not-yet-published work, I cannot include my files, but I believe that this issue would be fairly straightforward to re-create.

Thanks,

Patrick

@landinjm
Copy link
Contributor

This may have to do with the fact that the change terms for the Newton's method are hard-coded to 0. This should produce the result above since we haven't dealt with any other linear/nonlinear fields.

void variableContainer<dim,degree,T>::reinit_and_eval_change_in_solution(const vectorType &src, unsigned int cell, unsigned int var_being_solved){
if (varChangeInfoList[var_being_solved].is_scalar) {
scalar_change_in_vars[0].reinit(cell);
scalar_change_in_vars[0].read_dof_values(src);
scalar_change_in_vars[0].evaluate(varChangeInfoList[var_being_solved].need_value, varChangeInfoList[var_being_solved].need_gradient, varChangeInfoList[var_being_solved].need_hessian);
}
else {
vector_change_in_vars[0].reinit(cell);
vector_change_in_vars[0].read_dof_values(src);
vector_change_in_vars[0].evaluate(varChangeInfoList[var_being_solved].need_value, varChangeInfoList[var_being_solved].need_gradient, varChangeInfoList[var_being_solved].need_hessian);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants