flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
test_projected_guess_mpi.cpp File Reference
#include <mpi.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <Kokkos_Core.hpp>
#include <string>
#include <vector>
#include "flow_ibm.hpp"
#include "peclet/core/common/types.hpp"
#include "peclet/core/decomp/block_decomposer.hpp"

Go to the source code of this file.

Classes

struct  Case
struct  Arm

Typedefs

using IbmSolver

Enumerations

enum  Guess { kAuto = 0 , kZero = 1 , kProjected = 2 }

Functions

static double cylSdf (int x, int, int z)
static double colourAt (int x, int y, int z)
static double forceXAt (int, int, int z)
template<class Fn>
static std::vector< double > blockOf (Fn f, int ox, int oy, int oz, int lnx, int lny, int lnz)
static void configure (IbmSolver &s, const Case &c, const Arm &a, int guess, int ox, int oy, int oz, int lnx, int lny, int lnz)
static std::vector< std::vector< double > > stateOf (IbmSolver &s, bool vof)
static bool sameBits (const std::vector< std::vector< double > > &a, const std::vector< std::vector< double > > &b)
static bool sameBitsAll (IbmSolver &a, IbmSolver &b, bool vof)
static std::vector< double > gatherGlobal (const std::vector< double > &local, int ox, int oy, int oz, int lnx, int lny, int lnz, int rank, int size)
static double maxAbsDiff (const std::vector< double > &a, const std::vector< double > &b)
static std::string dbgDiff (const std::vector< double > &a, const std::vector< double > &b)
static double maxAbs (const std::vector< double > &a)
static std::vector< double > demean (std::vector< double > v)
static void check (int rank, bool ok, const std::string &what)
int main (int argc, char **argv)

Variables

static constexpr int NX = 16
static constexpr int NY = 16
static constexpr int NZ = 32
static constexpr int STEPS = 10
static constexpr int MAXIT = 400
static constexpr double RTOL = 1e-10
static constexpr std::size_t GCELLS = (std::size_t)NX * NY * NZ
static int fails = 0

Typedef Documentation

◆ IbmSolver

Definition at line 5663 of file flow_ibm.hpp.

Enumeration Type Documentation

◆ Guess

enum Guess
Enumerator
kAuto 
kZero 
kProjected 

Definition at line 57 of file test_projected_guess_mpi.cpp.

Function Documentation

◆ cylSdf()

double cylSdf ( int x,
int ,
int z )
static

Definition at line 59 of file test_projected_guess_mpi.cpp.

Referenced by configure().

◆ colourAt()

double colourAt ( int x,
int y,
int z )
static

Definition at line 63 of file test_projected_guess_mpi.cpp.

References NX, NY, and NZ.

◆ forceXAt()

double forceXAt ( int ,
int ,
int z )
static

Definition at line 71 of file test_projected_guess_mpi.cpp.

References NZ.

Referenced by configure(), configure(), and configure().

◆ blockOf()

template<class Fn>
std::vector< double > blockOf ( Fn f,
int ox,
int oy,
int oz,
int lnx,
int lny,
int lnz )
static

Definition at line 76 of file test_projected_guess_mpi.cpp.

Referenced by configure().

◆ configure()

void configure ( IbmSolver & s,
const Case & c,
const Arm & a,
int guess,
int ox,
int oy,
int oz,
int lnx,
int lny,
int lnz )
static

Definition at line 86 of file test_projected_guess_mpi.cpp.

References blockOf(), colourAt(), cylSdf(), forceXAt(), peclet::flow::LinearMix, MAXIT, and RTOL.

Referenced by main().

◆ stateOf()

std::vector< std::vector< double > > stateOf ( IbmSolver & s,
bool vof )
static

Definition at line 116 of file test_projected_guess_mpi.cpp.

Referenced by main(), and sameBitsAll().

◆ sameBits()

bool sameBits ( const std::vector< std::vector< double > > & a,
const std::vector< std::vector< double > > & b )
static

Definition at line 125 of file test_projected_guess_mpi.cpp.

Referenced by main(), and sameBitsAll().

◆ sameBitsAll()

bool sameBitsAll ( IbmSolver & a,
IbmSolver & b,
bool vof )
static

Definition at line 136 of file test_projected_guess_mpi.cpp.

References sameBits(), and stateOf().

Referenced by main().

◆ gatherGlobal()

std::vector< double > gatherGlobal ( const std::vector< double > & local,
int ox,
int oy,
int oz,
int lnx,
int lny,
int lnz,
int rank,
int size )
static

Definition at line 142 of file test_projected_guess_mpi.cpp.

References GCELLS, NX, and NY.

Referenced by main().

◆ maxAbsDiff()

double maxAbsDiff ( const std::vector< double > & a,
const std::vector< double > & b )
static

Definition at line 177 of file test_projected_guess_mpi.cpp.

Referenced by main().

◆ dbgDiff()

std::string dbgDiff ( const std::vector< double > & a,
const std::vector< double > & b )
static

Definition at line 187 of file test_projected_guess_mpi.cpp.

◆ maxAbs()

double maxAbs ( const std::vector< double > & a)
static

Definition at line 202 of file test_projected_guess_mpi.cpp.

Referenced by main().

◆ demean()

std::vector< double > demean ( std::vector< double > v)
static

Definition at line 208 of file test_projected_guess_mpi.cpp.

Referenced by main().

◆ check()

void check ( int rank,
bool ok,
const std::string & what )
static

Definition at line 219 of file test_projected_guess_mpi.cpp.

References fails.

Referenced by main().

◆ main()

Variable Documentation

◆ NX

int NX = 16
staticconstexpr

Definition at line 44 of file test_projected_guess_mpi.cpp.

◆ NY

int NY = 16
static

Definition at line 44 of file test_projected_guess_mpi.cpp.

◆ NZ

int NZ = 32
static

Definition at line 44 of file test_projected_guess_mpi.cpp.

◆ STEPS

int STEPS = 10
static

Definition at line 44 of file test_projected_guess_mpi.cpp.

◆ MAXIT

int MAXIT = 400
static

Definition at line 44 of file test_projected_guess_mpi.cpp.

◆ RTOL

double RTOL = 1e-10
staticconstexpr

Definition at line 45 of file test_projected_guess_mpi.cpp.

◆ GCELLS

std::size_t GCELLS = (std::size_t)NX * NY * NZ
staticconstexpr

Definition at line 46 of file test_projected_guess_mpi.cpp.

◆ fails

int fails = 0
static

Definition at line 218 of file test_projected_guess_mpi.cpp.

Referenced by check(), main(), and main().