PRISMS-PF Manual
Loading...
Searching...
No Matches
dependency_extents.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan
2// SPDX-License-Identifier: GNU Lesser General Public Version 2.1
3
4#pragma once
5
8
9#include <prismspf/config.h>
10
12inline unsigned int
13oldest(Dependency dependencies)
14{
15 for (long int age_index = long(dependencies.old_flags.size()) - 1; age_index >= 0;
16 age_index--)
17 {
18 if (dependencies.old_flags[age_index])
19 {
20 return age_index + 1;
21 }
22 }
23 return 0;
24}
25
31{
32 unsigned int oldest_age = 0;
33 unsigned int max_mg_level = 0;
34
35 // TODO: update this to account multigrid levels. Will need more
36 // than std::list<DependencyMap>
37 DependencyExtents(const std::set<unsigned int> &field_indices,
38 const std::list<DependencyMap> &all_dependeny_sets)
39 {
40 for (const DependencyMap &dependency_set : all_dependeny_sets)
41 {
42 for (unsigned int field_index : field_indices)
43 {
44 const auto &dep_pair_it = dependency_set.find(field_index);
45 if (dep_pair_it != dependency_set.end())
46 {
47 oldest_age = std::max(oldest_age, oldest(dep_pair_it->second));
48 }
49 }
50 }
51 }
52};
53
54PRISMS_PF_END_NAMESPACE
std::map< Types::Index, Dependency > DependencyMap
Definition dependencies.h:129
PRISMS_PF_BEGIN_NAMESPACE unsigned int oldest(Dependency dependencies)
Definition dependency_extents.h:13
Definition conditional_ostreams.cc:20
Information about what fields need to be held onto. This will likely get refactored to be an oldest a...
Definition dependency_extents.h:31
unsigned int max_mg_level
Definition dependency_extents.h:33
unsigned int oldest_age
Definition dependency_extents.h:32
DependencyExtents(const std::set< unsigned int > &field_indices, const std::list< DependencyMap > &all_dependeny_sets)
Definition dependency_extents.h:37
Dependency struct containing evaluation flags for each field.
Definition dependencies.h:30
std::vector< EvalFlags > old_flags
Collection of evaluation flags for the old solutions.
Definition dependencies.h:47