Hello Jack,

the error message is quite descriptive and tells you that something is off 
with the number of components of your Function object:

*The violated condition was:      exact_solution.n_components == 
n_components*

Check line 200 of your code:
        ExactSolution () : Function<dim>(dim+1) {}

You call the constructor for Function with 3 components (since dim=2 in 
your case). However, your implementation returns 7 components. Make sure 
that you call the constructor with the right number of components.

Marc

On Saturday, February 4, 2023 at 8:54:47 AM UTC-7 jack urombo wrote:

> i am using the implimenation by  Jaekwang Kim to model polymer flows. The 
> major change that I want to do is to output convergence tables like in 
> Step-7 and Step-22, which means I have to have an ExactSolution.
>
> The code is encountering an error because the dimension of the solutions 
> do not match at a some point when generating output:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *An error occurred in line <820> of file 
> </home/jurombo/Downloads/dealii-9.3.2/include/deal.II/numerics/vector_tools_integrate_difference.templates.h>
>  
> in function    void 
> dealii::VectorTools::internal::do_integrate_difference(const 
> dealii::hp::MappingCollection<dim, spacedim>&, const 
> dealii::DoFHandler<dim, spacedim>&, const InVector&, const 
> dealii::Function<spacedim, typename InVector::value_type>&, OutVector&, 
> const dealii::hp::QCollection<dim>&, const dealii::VectorTools::NormType&, 
> const dealii::Function<spacedim>*, double) [with int dim = 2; int spacedim 
> = 2; InVector = dealii::BlockVector<double>; OutVector = 
> dealii::Vector<double>; typename InVector::value_type = double] The 
> violated condition was:      exact_solution.n_components == n_components 
> Additional information:      Dimension 3 not equal to 7. Stacktrace: 
> ----------- #0  /usr/local/share/dealii/lib/libdeal_II.g.so.9.3.2:  #1 
>  /usr/local/share/dealii/lib/libdeal_II.g.so.9.3.2: void 
> dealii::VectorTools::integrate_difference<2, dealii::BlockVector<double>, 
> dealii::Vector<double>, 2>(dealii::Mapping<2, 2> const&, 
> dealii::DoFHandler<2, 2> const&, dealii::BlockVector<double> const&, 
> dealii::Function<2, dealii::BlockVector<double>::value_type> const&, 
> dealii::Vector<double>&, dealii::Quadrature<2> const&, 
> dealii::VectorTools::NormType const&, dealii::Function<2, double> const*, 
> double) #2  ./oldroyd_bn: 
> Viscoelastic::StokesProblem<2>::output_results(unsigned int) #3 
>  ./oldroyd_bn: Viscoelastic::StokesProblem<2>::run() #4  ./oldroyd_bn: main 
> --------------------------------------------------------*
> I have checked the ExactSolution in the code to try and figure wher the 
> error is occurring without success.
> Can anyone point me the direction to look. 
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/08f92f9c-0411-4fcf-81a8-e347f811eb15n%40googlegroups.com.

Reply via email to