core 0.5.0
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
adapt.hpp File Reference
#include <array>
#include <cmath>
#include <type_traits>
#include <utility>
#include <vector>
#include "peclet/core/amr/block_octree.hpp"
#include "peclet/core/amr/indicators.hpp"
#include "peclet/core/common/types.hpp"

Go to the source code of this file.

Classes

struct  peclet::core::amr::AdaptResult< Dim, Bits >
 

Namespaces

namespace  peclet
 
namespace  peclet::core
 
namespace  peclet::core::amr
 
namespace  peclet::core::amr::detail
 

Enumerations

enum  peclet::core::amr::AdaptFlag : int { peclet::core::amr::kCoarsen = -1 , peclet::core::amr::kKeep = 0 , peclet::core::amr::kRefine = 1 }
 Per-leaf adaptation flags from an indicator: refine where ind > refineThresh (and the leaf can go finer, level > finestLevel), coarsen where ind < coarsenThresh (and it can go coarser, level < lmax), else keep. More...
 

Functions

double peclet::core::amr::detail::minmod (double a, double b)
 
template<int Dim, unsigned Bits>
std::vector< std::array< double, Dim > > peclet::core::amr::transferFieldGradients (const BlockOctree< Dim, Bits > &oldT, const std::vector< double > &oldF)
 Per-old-leaf minmod prolongation gradients (per fine-coordinate unit) — transferField's stencil, exposed so a DISTRIBUTED caller can substitute halo-completed gradients (transferGradients in distributed_adapt.hpp): the block-local faceNeighbor returns -1 at block edges, which silently zeroes the gradient there — correct at a true domain edge (the single-rank convention) but np-DEPENDENT at interior block boundaries.
 
template<int Dim, unsigned Bits>
std::vector< doublepeclet::core::amr::transferField (const BlockOctree< Dim, Bits > &oldT, const std::vector< double > &oldF, const BlockOctree< Dim, Bits > &newT, bool linear=true, const std::type_identity_t< std::vector< std::array< double, Dim > > > *gradIn=nullptr)
 Conservative remap of a leaf field from oldT to newT (same domain).
 
template<int Dim, unsigned Bits>
std::vector< intpeclet::core::amr::flagByIndicator (const BlockOctree< Dim, Bits > &t, const std::vector< double > &ind, double refineThresh, double coarsenThresh, unsigned finestLevel=0)
 
template<int Dim, unsigned Bits>
AdaptResult< Dim, Bitspeclet::core::amr::adaptField (const BlockOctree< Dim, Bits > &t, const std::vector< double > &f, const std::vector< int > &flags, bool linear=true)
 Apply adaptation flags (one level of refine/coarsen) to t carrying field f, then 2:1-balance and remap.
 
template<int Dim, unsigned Bits>
AdaptResult< Dim, Bitspeclet::core::amr::adapt (const BlockOctree< Dim, Bits > &t, const std::vector< double > &f, double refineThresh, double coarsenThresh, unsigned finestLevel=0, double eps=0.01, bool linear=true)
 All-in-one solution-adaptive step: Löhner indicator → flags → adaptField.