libsc  2.8.7
The SC library provides support for parallel scientific applications.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sc_amr.h
1 /*
2  This file is part of the SC Library.
3  The SC Library provides support for parallel scientific applications.
4 
5  Copyright (C) 2010 The University of Texas System
6  Additional copyright (C) 2011 individual authors
7 
8  The SC Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  The SC Library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with the SC Library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 */
23 
24 #ifndef SC_AMR_H
25 #define SC_AMR_H
26 
27 #include <sc_statistics.h>
28 
29 SC_EXTERN_C_BEGIN;
30 
31 typedef struct sc_amr_control
32 {
33  const double *errors;
34  sc_statinfo_t estats;
35  sc_MPI_Comm mpicomm;
36  long num_procs_long;
37  long num_total_elements;
38  double coarsen_threshold;
39  double refine_threshold;
40  long num_total_coarsen;
41  long num_total_refine;
42  long num_total_estimated;
43 }
45 
53 void sc_amr_error_stats (sc_MPI_Comm mpicomm,
54  long num_local_elements,
55  const double *errors,
56  sc_amr_control_t * amr);
57 
66 typedef long (*sc_amr_count_coarsen_fn) (sc_amr_control_t * amr,
67  void *user_data);
68 
77 typedef long (*sc_amr_count_refine_fn) (sc_amr_control_t * amr,
78  void *user_data);
79 
88 void sc_amr_coarsen_specify (int package_id,
89  sc_amr_control_t * amr,
90  double coarsen_threshold,
91  sc_amr_count_coarsen_fn cfn,
92  void *user_data);
93 
105 void sc_amr_coarsen_search (int package_id,
106  sc_amr_control_t * amr,
107  long num_total_ideal,
108  double coarsen_threshold_high,
109  double target_window,
110  int max_binary_steps,
111  sc_amr_count_coarsen_fn cfn,
112  void *user_data);
113 
125 void sc_amr_refine_search (int package_id,
126  sc_amr_control_t * amr,
127  long num_total_ideal,
128  double refine_threshold_low,
129  double target_window,
130  int max_binary_steps,
131  sc_amr_count_refine_fn rfn,
132  void *user_data);
133 
134 SC_EXTERN_C_END;
135 
136 #endif /* !SC_AMR_H */
sc3_MPI_Comm_t sc_MPI_Comm
Emulate an MPI communicator.
Definition: sc_mpi.h:450
Computation of average and mean values etc.
Definition: sc_amr.h:32
Store information of one random variable.
Definition: sc_statistics.h:44