Initial composition ascii model. error while in 3D

Hello. I am trying to set initial composition ascii model in convection-box-3d from cookbooks. But when I run aspect I get following error:

An error occurred in line <139> of file </home/mk/source/aspect/source/initial_composition/interface.cc> in function
    void aspect::InitialComposition::Manager<dim>::parse_parameters(dealii::ParameterHandler&) [with int dim = 3]
The violated condition was: 
    this->n_compositional_fields() > 0
Additional information: 
    A plugin for the initial composition condition was specified, but there is no compositional field. This can lead to errors within the initialization of the initial composition plugin and is therefore not supported. Please remove the initial composition plugin or add a compositional field.

My changes to the file convection-box-3d.prm:

  subsection Initial composition model
    set Model name = ascii data
    
    subsection Ascii data model
      set Data directory       = prescribed_velocity/
      set Data file name       = test3d.txt
    end 
  end

And here is content of test3d.txt:

  # POINTS: 3 3 3
  # Columns: x y z composition_1
  0   0   0   1   
  0.5 0   0   1   
  1   0   0   1   
  0   0.5 0   1   
  0.5 0.5 0   2   
  1   0.5 0   1   
  0   1   0   1   
  0.5 1   0   1   
  1   1   0   1   
  0   0   0.5 1 
  0.5 0   0.5 1 
  1   0   0.5 1 
  0   0.5 0.5 1 
  0.5 0.5 0.5 2 
  1   0.5 0.5 1 
  0   1   0.5 1 
  0.5 1   0.5 1 
  1   1   0.5 1 
  0   0   1   1   
  0.5 0   1   1   
  1   0   1   1   
  0   0.5 1   1 
  0.5 0.5 1   2   
  1   0.5 1   1 
  0   1   1   1   
  0.5 1   1   1   
  1   1   1   1 

Here is my aspect info:

-- This is ASPECT, the Advanced Solver for Problems in Earth's ConvecTion.
--     . version 2.1.0-pre (master, d74446cc3)
--     . using deal.II 9.0.1
--     . using Trilinos 12.10.1
--     . using p4est 2.0.0
--     . running in DEBUG mode
--     . running with 1 MPI process

I tried to set the filename so it referenced non-existed file, but had the same error as above. It looks like parsing doesn’t actually go to actual loading of a file, and the error arises earlier and has no to do with actual content of my ascii file.

Simulation successfully runs when I use 2d version of a problem (with changed ascii file for 2d case).

I would appreciate any advice. Thanks in advance.

The error message suggests that in your input file, you do not actually specify how many compositional fields you have. The default is zero, and in that case specifying initial condition for any compositional fields should yield the error you show.

Can you show the section in your input file that specifies the compositional fields?

Best
W.

What do you mean by input file? The full content of ascii file is in the post. If you mean .prm file then could you specify where exactly should I set how many compositional fields do I have? (Unfortunately I don’t have access to my computer at that time).

I forgot to put first line of the ascii file in my first post. I edited the post.

Do I have to specify how many compositional fields I have right in this ascii file?

Thank you.

Yes, I mean the .prm file. For example, taking a more or less random file from the testsuite, you probably have a section that looks like this:

subsection Compositional fields
    set Number of fields = 2
end

In your case, I suspect that the section is either missing, or that you set the number of fields to zero. But then you still specify which kind of boundary values you want to have for the compositional fields, and what ASPECT is saying that this does not make sense.

Best
W.

Thanks for a prompt answer. I’ll try tomorrow and let you know if it helps.

How can you explain why 2d version of my prm file successfully runs without that section? This error arises only in 3d version.

I don’t know. There are so many possibilities to make mistakes in input files (and there is also the possibility that there is a mistake in ASPECT), but we can’t tell without more information – you will need to show us the two files!

Best
W.

Hello Wolfgang. I’ve checked my .prm file. As you have said the problem was caused by missing subsection “Compositional fields”. Such a silly mistake. Thank you for your help and thanks for a wonderful software!

Best
Mikhail.

Mikhail: Thanks for the kind words and glad to help. It’s easy to think
about potential causes for errors since I’ve made all of these mistakes
myself at one point or other :slight_smile: