Skip to content

Commit f537114

Browse files
authored
Merge pull request #6051 from gassmoeller/particle_component_update
Only evaluate necessary solution components during particle property update
2 parents 6f62c75 + daea71b commit f537114

34 files changed

+412
-164
lines changed

include/aspect/introspection.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,34 @@ namespace aspect
355355
{
356356
ComponentMasks (const FEVariableCollection<dim> &fevs, const Introspection<dim>::ComponentIndices &indices);
357357

358+
/**
359+
* The component mask for all velocity components.
360+
*/
358361
ComponentMask velocities;
362+
363+
/**
364+
* The component mask for the pressure component.
365+
*/
359366
ComponentMask pressure;
367+
368+
/**
369+
* The component mask for the temperature component.
370+
*/
360371
ComponentMask temperature;
372+
373+
/**
374+
* The component mask for each individual compositional field.
375+
* The size of this vector is equal to the number of compositional fields.
376+
* Each entry is a component mask that selects the component
377+
* that corresponds to the respective compositional field.
378+
*/
361379
std::vector<ComponentMask> compositional_fields;
380+
381+
/**
382+
* The component mask for all composition components.
383+
* This mask selects all compositional fields.
384+
*/
385+
ComponentMask compositions;
362386
};
363387

364388
/**

include/aspect/particle/property/composition.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ namespace aspect
7272
need_update () const override;
7373

7474
/**
75-
* Return which data has to be provided to update the property.
76-
* The pressure and temperature need the values of their variables.
75+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
7776
*/
7877
UpdateFlags
79-
get_needed_update_flags () const override;
78+
get_update_flags (const unsigned int component) const override;
8079

8180
/**
8281
* Set up the information about the names and number of components

include/aspect/particle/property/cpo_bingham_average.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ namespace aspect
113113
need_update () const override;
114114

115115
/**
116-
* Return which data has to be provided to update the property.
117-
* The integrated strains needs the gradients of the velocity.
116+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
118117
*/
119118
UpdateFlags
120-
get_needed_update_flags () const override;
119+
get_update_flags (const unsigned int component) const override;
121120

122121
/**
123122
* Set up the information about the names and number of components

include/aspect/particle/property/cpo_elastic_tensor.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ namespace aspect
104104
need_update () const override;
105105

106106
/**
107-
* Return which data has to be provided to update the property.
108-
* For example, the strains needs the gradients of the velocity.
107+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
109108
*/
110109
UpdateFlags
111-
get_needed_update_flags () const override;
110+
get_update_flags (const unsigned int component) const override;
112111

113112
/**
114113
* Set up the information about the names and number of components

include/aspect/particle/property/crystal_preferred_orientation.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,10 @@ namespace aspect
178178
late_initialization_mode () const override;
179179

180180
/**
181-
* Return which data has to be provided to update the property.
182-
* The integrated strains needs the gradients of the velocity.
181+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
183182
*/
184183
UpdateFlags
185-
get_needed_update_flags () const override;
184+
get_update_flags (const unsigned int component) const override;
186185

187186
/**
188187
* Set up the information about the names and number of components

include/aspect/particle/property/elastic_stress.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ namespace aspect
7171
need_update () const override;
7272

7373
/**
74-
* @copydoc aspect::Particle::Property::Interface::get_needed_update_flags()
74+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
7575
*/
7676
UpdateFlags
77-
get_needed_update_flags () const override;
77+
get_update_flags (const unsigned int component) const override;
7878

7979
/**
8080
* @copydoc aspect::Particle::Property::Interface::get_property_information()

include/aspect/particle/property/grain_size.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ namespace aspect
8585
need_update () const override;
8686

8787
/**
88-
* @copydoc aspect::Particle::Property::Interface::get_needed_update_flags()
88+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
8989
*/
9090
UpdateFlags
91-
get_needed_update_flags () const override;
91+
get_update_flags (const unsigned int component) const override;
9292

9393
/**
9494
* @copydoc aspect::Particle::Property::Interface::get_property_information()

include/aspect/particle/property/integrated_strain.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ namespace aspect
7373
need_update () const override;
7474

7575
/**
76-
* Return which data has to be provided to update the property.
77-
* The integrated strains needs the gradients of the velocity.
76+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
7877
*/
7978
UpdateFlags
80-
get_needed_update_flags () const override;
79+
get_update_flags (const unsigned int component) const override;
8180

8281
/**
8382
* Set up the information about the names and number of components

include/aspect/particle/property/integrated_strain_invariant.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ namespace aspect
7272
need_update () const override;
7373

7474
/**
75-
* Return which data has to be provided to update the property.
76-
* The integrated strains needs the gradients of the velocity.
75+
* @copydoc aspect::Particle::Property::Interface::get_update_flags()
7776
*/
7877
UpdateFlags
79-
get_needed_update_flags () const override;
78+
get_update_flags (const unsigned int component) const override;
8079

8180
/**
8281
* Set up the information about the names and number of components

include/aspect/particle/property/interface.h

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,42 @@ namespace aspect
434434
UpdateTimeFlags
435435
need_update () const;
436436

437+
/**
438+
* Return which data of the solution component @p component
439+
* has to be provided to update the current particle property.
440+
*
441+
* Note that particle properties can only ask for update_default
442+
* (no data), update_values (solution values), and update_gradients
443+
* (solution gradients). All other update flags will have no effect.
444+
*
445+
* As an example consider a particle property that depends on the
446+
* solution values and gradients of the velocity field. In this case
447+
* the function should return update_values | update_gradients if the
448+
* @p component is one of the velocity components, and update_default
449+
* otherwise.
450+
*
451+
* @param component The component of the solution which is to be
452+
* evaluated.
453+
*
454+
* @return The necessary update flags for the solution component
455+
* @p component that is required for this particle property.
456+
*/
457+
virtual
458+
UpdateFlags
459+
get_update_flags (const unsigned int component) const;
460+
437461
/**
438462
* Return which data has to be provided to update all properties.
439463
* Note that particle properties can only ask for update_default
440464
* (no data), update_values (solution values), and update_gradients
441465
* (solution gradients). All other update flags will have no effect.
442466
*
443467
* @return The necessary update flags for this particle property.
468+
*
469+
* @deprecated This function is deprecated. Use the above version of
470+
* get_update_flags() instead.
444471
*/
472+
DEAL_II_DEPRECATED
445473
virtual
446474
UpdateFlags
447475
get_needed_update_flags () const;
@@ -624,9 +652,16 @@ namespace aspect
624652
* Note that particle properties can only ask for update_default
625653
* (no data), update_values (solution values), and update_gradients
626654
* (solution gradients). All other update flags will have no effect.
655+
* The result of this function is a combination of the
656+
* get_update_flags() functions of all individual properties
657+
* that are selected.
658+
*
659+
* @return A vector that contains the update flags that are
660+
* required to update all particle properties. The vector has as many entries
661+
* as there solution components.
627662
*/
628-
UpdateFlags
629-
get_needed_update_flags () const;
663+
std::vector<UpdateFlags>
664+
get_update_flags () const;
630665

631666
/**
632667
* Checks if the particle plugin specified by @p name exists

0 commit comments

Comments
 (0)