71 void pragmatic_2d_init(
const int *NNodes,
const int *NElements,
const int *enlist,
const double *x,
const double *y){
73 throw new std::string(
"PRAgMaTIc: only one mesh can be adapted at a time");
92 void pragmatic_3d_init(
const int *NNodes,
const int *NElements,
const int *enlist,
const double *x,
const double *y,
const double *z){
130 metric_field->
add_field(psi, *error, *pnorm);
136 metric_field->
add_field(psi, *error, *pnorm);
142 std::cerr<<
"WARNING: Fortran interface currently only supports adding a single field.\n";
196 double L_up = sqrt(2.0);
197 double L_low = L_up*0.5;
207 double alpha = sqrt(2.0)/2.0;
208 for(
size_t i=0;i<20;i++){
209 double L_ref = std::max(alpha*L_max, L_up);
217 if(L_max>1.0 && (L_max-L_up)<0.01)
235 double alpha = sqrt(2.0)/2.0;
236 for(
size_t i=0;i<10;i++){
237 double L_ref = std::max(alpha*L_max, L_up);
245 if((L_max-L_up)<0.01)
270 for(
size_t i=0;i<NNodes;i++){
278 for(
size_t i=0;i<NNodes;i++){
288 const size_t nloc = (ndims==2)?3:4;
290 for(
size_t i=0;i<NElements;i++){
293 for(
size_t j=0;j<nloc;j++){
295 elements[i*nloc+j] = n[j];
void smart_laplacian(int max_iterations=10, double quality_tol=-1.0)
static void * _pragmatic_mesh
void update_mesh()
Update the metric field on the mesh.
void set_metric_full(const real_t *metric)
void refine(real_t L_max)
Performs 2D mesh coarsening.
void pragmatic_3d_init(const int *NNodes, const int *NElements, const int *enlist, const double *x, const double *y, const double *z)
Performs edge/face swapping.
void coarsen(real_t L_low, real_t L_max, bool enable_sliver_deletion=false)
Constructs metric tensor field which encodes anisotropic edge size information.
void add_field(const real_t *psi, const real_t target_error, int p_norm=-1)
size_t get_number_elements() const
Return the number of elements in the mesh.
void pragmatic_set_boundary(const int *nfacets, const int *facets, const int *ids)
void pragmatic_vtk_init(const char *filename)
static void * _pragmatic_metric_field
real_t maximal_edge_length() const
void swap(real_t quality_tolerance)
void pragmatic_finalize()
void pragmatic_get_metric(double *metric)
void pragmatic_2d_init(const int *NNodes, const int *NElements, const int *enlist, const double *x, const double *y)
void pragmatic_set_metric(const double *metric)
size_t get_number_dimensions() const
Return the number of spatial dimensions.
void pragmatic_add_field(const double *psi, const double *error, int *pnorm)
void pragmatic_get_coords_2d(double *x, double *y)
size_t get_number_nodes() const
Return the number of nodes in the mesh.
Applies Laplacian smoothen in metric space.
void pragmatic_get_info(int *NNodes, int *NElements)
void pragmatic_dump(const char *filename)
void set_boundary(int nfacets, const int *facets, const int *ids)
void pragmatic_get_elements(int *elements)
void pragmatic_dump_debug()
Performs 2D mesh refinement.
void pragmatic_get_coords_3d(double *x, double *y, double *z)
void optimisation_linf(int max_iterations=10, double quality_tol=-1.0)