Added model solution for reductions and functions for automated testing

This commit is contained in:
jpekkila
2020-06-03 13:37:00 +03:00
parent 34793d4e8b
commit 226de32651
7 changed files with 287 additions and 24 deletions

View File

@@ -29,6 +29,25 @@
extern "C" {
#endif
#include <stdbool.h>
typedef struct {
VertexBufferHandle handle;
AcReal model;
AcReal candidate;
long double abs_error;
long double ulp_error;
long double rel_error;
AcReal maximum_magnitude;
AcReal minimum_magnitude;
} Error;
/** TODO comment */
Error acGetError(AcReal model, AcReal candidate);
/** TODO comment */
bool printErrorToScreen(const Error error);
/** Loads data from the config file */
AcResult acLoadConfig(const char* config_path, AcMeshInfo* config);
@@ -56,6 +75,15 @@ AcResult acMeshClear(AcMesh* mesh);
/** */
AcResult acModelIntegrateStep(AcMesh mesh, const AcReal dt);
/** TODO */
AcReal
acModelReduceScal(const AcMesh mesh, const ReductionType rtype, const VertexBufferHandle a);
/** TODO */
AcReal
acModelReduceVec(const AcMesh mesh, const ReductionType rtype, const VertexBufferHandle a,
const VertexBufferHandle b, const VertexBufferHandle c);
/** */
AcResult acVerifyMesh(const AcMesh model, const AcMesh candidate);