Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-02-04 Thread Wolfgang Bangerth
On 2/3/20 12:16 PM, Andrew Davis wrote: I have not looked deeply into whether this function is called in a lot of places. Attached is an implementation of a time-dependent advection equation with an adaptive mesh. It seems like it is working given the changes that I made but it does not work gi

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-02-03 Thread Andrew Davis
I have not looked deeply into whether this function is called in a lot of places. Attached is an implementation of a time-dependent advection equation with an adaptive mesh. It seems like it is working given the changes that I made but it does not work given the current master branch. I can cl

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-31 Thread Wolfgang Bangerth
On 1/30/20 2:48 PM, Andrew Davis wrote: > I found a fix for this by editing the deal.ii source code. I am very new to > deal.ii so it is extremely likely that there is a way to accomplish what I > want without touching the deal.ii source or there might be a better way of > editing the source. So

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-31 Thread Wolfgang Bangerth
On 1/30/20 1:39 PM, Andrew Davis wrote: > Fair point. I reinstalled in Debug mode and now I'm failing at that Assert. So learning opportunity: You could have saved yourself a lot of searching of where the problem actually is by always first running your program in debug mode :-) > Here is th

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
I found a fix for this by editing the deal.ii source code. I am very new to deal.ii so it is extremely likely that there is a way to accomplish what I want without touching the deal.ii source or there might be a better way of editing the source. So, here is the fix that worked for me. Let me kno

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
Fair point. I reinstalled in Debug mode and now I'm failing at that Assert. Here is the error message (using the same code I attached previously): An error occurred in line <2891> of file in function dealii::types::global_dof_index dealii::FEValuesBase::TriaCellIterator::n_dofs_for_dof_ha

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Bruno Turcksin
On Thursday, January 30, 2020 at 2:28:55 PM UTC-5, Andrew Davis wrote: > > > from the file fe_values.impl.2.inst.in. The Assert(false) seems strange > to me---why doesn't it crash? (I'm in Release mode so that could answer > that). However, should it be calling a different function? > > You shoul

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
I'm continuing to dig into this problem. For some reason the ` get_function_values` is calling the function for (VEC : VECTOR_TYPES) { template void FEValuesBase::TriaCellIterator::get_interpolated_dof_values( const VEC &, Vector &) const { // Assert(false, ExcMessa

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
As another diagnostic---I added cout statements in the function ` get_function_values` in fe_values.cc. It looks like the values of the input variable `fe_function` are correct but the `dof_values` are always set to zero. Specifically: // get function values of dofs on this cell Vector dof

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
Sure, attached is a *.cpp file that should run. The cout statement on line 87 prints non-zero values for `old_solution` but the cout statement online 92 always prints zero. On Thursday, January 30, 2020 at 10:49:18 AM UTC-5, Wolfgang Bangerth wrote: > > On 1/30/20 8:45 AM, Andrew Davis wrote: >

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Wolfgang Bangerth
On 1/30/20 8:45 AM, Andrew Davis wrote: > I thought the same thing---that 'old_solution' would be a zero vector---but > when I add the line `std::cout << old_solution << std::endl;` in the function > IntegrateCell::operator() (just after the `get_function_values' call in > the original post) pri

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Andrew Davis
I thought the same thing---that 'old_solution' would be a zero vector---but when I add the line `std::cout << old_solution << std::endl;` in the function IntegrateCell::operator() (just after the ` get_function_values' call in the original post) prints a non-zero vector that I expect. On Thursd

Re: [deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-30 Thread Wolfgang Bangerth
On 1/29/20 1:14 PM, Andrew Davis wrote: > * > * > *For some reason the feValues.get_function_values(old_solution, > old_solution_values); call in the CellIntegrator function always sets the > old_solution_values to zero. Does anyone see what I'm doing wrong?* So the output of this function is wr

[deal.II] Getting old solution values at quadrature points using MeshWorker::loop

2020-01-29 Thread Andrew Davis
I'm trying to implement a time-dependent solver that assembles the system using the MeshWorker::loop tool. However, I cannot figure out how get the values of the solution at the previous timestep at each quadrature point. Currently, I store the old solution in a class called "AdvectionProblem"