Astaroth  3.1
Scalable Multi-GPU Stencil Computations
Loading...
Searching...
No Matches
astaroth_utils.h File Reference

Functions for loading and updating AcMeshInfo. More...

#include <stdarg.h>
#include "astaroth.h"
#include "func_define.h"
Include dependency graph for astaroth_utils.h:

Go to the source code of this file.

Data Structures

struct  Error

Macros

#define AC_BLU   "\x1B[34m"
#define AC_COL_RESET   "\x1B[0m"
#define AC_CYN   "\x1B[36m"
#define AC_GRN   "\x1B[32m"
#define AC_MAG   "\x1B[35m"
#define AC_RED   "\x1B[31m"
#define AC_WHT   "\x1B[37m"
#define AC_YEL   "\x1B[33m"

Functions

AcResult __attribute__ ((unused)) acLoadConfig(const char *config_path
bool acEvalError (const char *label, const Error error)
bool acEvalErrorWithMaximumError (const char *label, const Error error, const long double max_ulp_error)
Error acGetError (const AcReal model, const AcReal candidate)
AcResult acHostInitProfileToCosineWave (const AcReal spacing, const AcReal initial_pos, const AcReal amplitude, const AcReal wavenumber, const size_t mz, AcReal *profile)
AcResult acHostInitProfileToSineWave (const AcReal spacing, const AcReal initial_pos, const AcReal amplitude, const AcReal wavenumber, const size_t mz, AcReal *profile)
AcResult acHostInitProfileToValue (const long double value, const size_t profile_count, AcReal *profile)
AcResult acHostIntegrateStep (AcMesh mesh, const AcReal dt)
AcResult acHostMeshApplyConstantBounds (const AcReal value, AcMesh *mesh)
AcResult acHostMeshApplyPeriodicBounds (AcMesh *mesh)
AcResult acHostMeshClear (AcMesh *mesh)
AcResult acHostMeshReadFromFile (const size_t id, AcMesh *mesh)
AcResult acHostMeshSet (const AcReal value, AcMesh *mesh)
AcResult acHostMeshWriteToFile (const AcMesh mesh, const size_t id)
AcResult acHostProfileDerz (const AcReal *in, const size_t count, const AcReal grid_spacing, AcReal *out)
AcResult acHostProfileDerzz (const AcReal *in, const size_t count, const AcReal grid_spacing, AcReal *out)
AcReal acHostReduceScal (const AcMesh mesh, const AcReduction reduction, const VertexBufferHandle a)
AcReal acHostReduceVec (const AcMesh mesh, const AcReduction reduction, const VertexBufferHandle a, const VertexBufferHandle b, const VertexBufferHandle c)
AcReal acHostReduceVecScal (const AcMesh mesh, const AcReduction reduction, const VertexBufferHandle a, const VertexBufferHandle b, const VertexBufferHandle c, const VertexBufferHandle d)
AcResult acHostReduceXYAverage (const AcReal *in, const AcMeshDims dims, AcReal *out)
AcResult acHostVertexBufferSet (const VertexBufferHandle handle, const AcReal value, AcMesh *mesh)
AcResult acHostWriteProfileToFile (const char *filepath, const AcReal *profile, const size_t profile_count)
AcResult acLoadUtils (const AcMeshInfo info)
AcResult acMeshDiffWrite (const char *path, const AcMesh model, const AcMesh candidate)
AcResult acMeshDiffWriteSliceZ (const char *path, const AcMesh model, const AcMesh candidate, const size_t z)
AcResult acVerifyMesh (const char *label, const AcMesh model, const AcMesh candidate)
AcResult acVerifyMeshCompDomain (const char *label, const AcMesh model, const AcMesh candidate)
AcResult acVerifyMeshWithMaximumError (const char *label, const AcMesh model, const AcMesh candidate, const long double max_ulp_error)

Variables

AcResult AcMeshInfo * config

Detailed Description

Functions for loading and updating AcMeshInfo.

Macro Definition Documentation

◆ AC_BLU

#define AC_BLU   "\x1B[34m"

◆ AC_COL_RESET

#define AC_COL_RESET   "\x1B[0m"

◆ AC_CYN

#define AC_CYN   "\x1B[36m"

◆ AC_GRN

#define AC_GRN   "\x1B[32m"

◆ AC_MAG

#define AC_MAG   "\x1B[35m"

◆ AC_RED

#define AC_RED   "\x1B[31m"

◆ AC_WHT

#define AC_WHT   "\x1B[37m"

◆ AC_YEL

#define AC_YEL   "\x1B[33m"

Function Documentation

◆ __attribute__()

AcResult __attribute__ ( (unused) ) const

◆ acEvalError()

bool acEvalError ( const char * label,
const Error error )

◆ acEvalErrorWithMaximumError()

bool acEvalErrorWithMaximumError ( const char * label,
const Error error,
const long double max_ulp_error )

◆ acGetError()

Error acGetError ( const AcReal model,
const AcReal candidate )

◆ acHostInitProfileToCosineWave()

AcResult acHostInitProfileToCosineWave ( const AcReal spacing,
const AcReal initial_pos,
const AcReal amplitude,
const AcReal wavenumber,
const size_t mz,
AcReal * profile )

Inits the profile to cosine wave

◆ acHostInitProfileToSineWave()

AcResult acHostInitProfileToSineWave ( const AcReal spacing,
const AcReal initial_pos,
const AcReal amplitude,
const AcReal wavenumber,
const size_t mz,
AcReal * profile )

Inits the profile to sine wave

◆ acHostInitProfileToValue()

AcResult acHostInitProfileToValue ( const long double value,
const size_t profile_count,
AcReal * profile )

Initialize a profile to a constant value

◆ acHostIntegrateStep()

AcResult acHostIntegrateStep ( AcMesh mesh,
const AcReal dt )

Applies a full integration step on host mesh using the compact 2N RK3 scheme. The boundaries are not updated after the final substep. A call to acHostMeshApplyPeriodicBounds is required if this is not desired. NOTE: applies boundary conditions on the mesh before the initial substep.

◆ acHostMeshApplyConstantBounds()

AcResult acHostMeshApplyConstantBounds ( const AcReal value,
AcMesh * mesh )

◆ acHostMeshApplyPeriodicBounds()

AcResult acHostMeshApplyPeriodicBounds ( AcMesh * mesh)

◆ acHostMeshClear()

AcResult acHostMeshClear ( AcMesh * mesh)

◆ acHostMeshReadFromFile()

AcResult acHostMeshReadFromFile ( const size_t id,
AcMesh * mesh )

◆ acHostMeshSet()

AcResult acHostMeshSet ( const AcReal value,
AcMesh * mesh )

◆ acHostMeshWriteToFile()

AcResult acHostMeshWriteToFile ( const AcMesh mesh,
const size_t id )

◆ acHostProfileDerz()

AcResult acHostProfileDerz ( const AcReal * in,
const size_t count,
const AcReal grid_spacing,
AcReal * out )

◆ acHostProfileDerzz()

AcResult acHostProfileDerzz ( const AcReal * in,
const size_t count,
const AcReal grid_spacing,
AcReal * out )

◆ acHostReduceScal()

AcReal acHostReduceScal ( const AcMesh mesh,
const AcReduction reduction,
const VertexBufferHandle a )

◆ acHostReduceVec()

AcReal acHostReduceVec ( const AcMesh mesh,
const AcReduction reduction,
const VertexBufferHandle a,
const VertexBufferHandle b,
const VertexBufferHandle c )

◆ acHostReduceVecScal()

AcReal acHostReduceVecScal ( const AcMesh mesh,
const AcReduction reduction,
const VertexBufferHandle a,
const VertexBufferHandle b,
const VertexBufferHandle c,
const VertexBufferHandle d )

◆ acHostReduceXYAverage()

AcResult acHostReduceXYAverage ( const AcReal * in,
const AcMeshDims dims,
AcReal * out )

◆ acHostVertexBufferSet()

AcResult acHostVertexBufferSet ( const VertexBufferHandle handle,
const AcReal value,
AcMesh * mesh )

◆ acHostWriteProfileToFile()

AcResult acHostWriteProfileToFile ( const char * filepath,
const AcReal * profile,
const size_t profile_count )

Writes the host profile to a file

◆ acLoadUtils()

AcResult acLoadUtils ( const AcMeshInfo info)

◆ acMeshDiffWrite()

AcResult acMeshDiffWrite ( const char * path,
const AcMesh model,
const AcMesh candidate )

◆ acMeshDiffWriteSliceZ()

AcResult acMeshDiffWriteSliceZ ( const char * path,
const AcMesh model,
const AcMesh candidate,
const size_t z )

◆ acVerifyMesh()

AcResult acVerifyMesh ( const char * label,
const AcMesh model,
const AcMesh candidate )

◆ acVerifyMeshCompDomain()

AcResult acVerifyMeshCompDomain ( const char * label,
const AcMesh model,
const AcMesh candidate )

◆ acVerifyMeshWithMaximumError()

AcResult acVerifyMeshWithMaximumError ( const char * label,
const AcMesh model,
const AcMesh candidate,
const long double max_ulp_error )

Variable Documentation

◆ config