Temporary repository used to save branch code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <macros.h>
#include <math/math_defs.h>
#include <io_blobtree.h>
#include <settings.h>
typedef struct {
const vector3d* vertices;
const uint32_t* faces; // indices of vertices in each face
const uint32_t* vertex_counts; // number of vertices in each face
uint32_t num_vertices;
uint32_t num_faces;
} polymesh_t;
typedef struct {
polymesh_t mesh;
bool success;
} primitive_generation_result_t;
typedef struct {
void *v00, *v01, *v02;
void *v10, *v11, *v12;
void *v20, *v21, *v22;
} integrator_t;
typedef struct {
double coeff;
uint8_t p1, p2, p3;
} integrand_handle_t;
typedef struct {
double area;
double volume;
} polymesh_integral_result_t;
EXTERN_C_BEGIN
// forward declartions
class implicit_network_solver;
API implicit_network_solver* create_solver(const baked_blobtree_t* tree, const s_settings settings) noexcept;
API void destroy_solver(implicit_network_solver* solver) noexcept;
API primitive_generation_result_t generate_polymesh(implicit_network_solver* solver);
//API integrator_t generate_integral_scheme(implicit_network_solver* solver);
// output time usage statistics to console
API void print_statistics(const implicit_network_solver* solver);
API void clear_statistics(implicit_network_solver* solver);
// clear the cache of previous solver results
// CAUTION: output result should be invalid after calling this function
API void clear_solver_cache(implicit_network_solver* solver);
//API double calculate_surface_integrand(const integrator_t integrator, integrand_handle_t handle);
//API double calculate_volume_integrand(const integrator_t integrator, integrand_handle_t handle);
// just for a baseline
API polymesh_integral_result_t polymesh_area_and_volume(const implicit_network_solver* solver);
EXTERN_C_END