1 /* 2 An index set is a generalization of a subset of integers. Index sets 3 are used for defining scatters and gathers. 4 */ 5 #if !defined(__PETSCIS_H) 6 #define __PETSCIS_H 7 #include <petscsys.h> 8 #include <petscsf.h> 9 10 #define IS_FILE_CLASSID 1211218 11 PETSC_EXTERN PetscClassId IS_CLASSID; 12 13 PETSC_EXTERN PetscErrorCode ISInitializePackage(const char[]); 14 15 /*S 16 IS - Abstract PETSc object that allows indexing. 17 18 Level: beginner 19 20 Concepts: indexing, stride 21 22 .seealso: ISCreateGeneral(), ISCreateBlock(), ISCreateStride(), ISGetIndices(), ISDestroy() 23 S*/ 24 typedef struct _p_IS* IS; 25 26 /*J 27 ISType - String with the name of a PETSc vector or the creation function 28 with an optional dynamic library name, for example 29 http://www.mcs.anl.gov/petsc/lib.a:myveccreate() 30 31 Level: beginner 32 33 .seealso: ISSetType(), IS 34 J*/ 35 typedef const char* ISType; 36 #define ISGENERAL "general" 37 #define ISSTRIDE "stride" 38 #define ISBLOCK "block" 39 40 /* Dynamic creation and loading functions */ 41 PETSC_EXTERN PetscFunctionList ISList; 42 PETSC_EXTERN PetscBool ISRegisterAllCalled; 43 PETSC_EXTERN PetscErrorCode ISSetType(IS, ISType); 44 PETSC_EXTERN PetscErrorCode ISGetType(IS, ISType *); 45 PETSC_EXTERN PetscErrorCode ISRegister(const char[],const char[],const char[],PetscErrorCode (*)(IS)); 46 PETSC_EXTERN PetscErrorCode ISRegisterAll(const char []); 47 PETSC_EXTERN PetscErrorCode ISRegisterDestroy(void); 48 PETSC_EXTERN PetscErrorCode ISCreate(MPI_Comm,IS*); 49 50 /*MC 51 ISRegisterDynamic - Adds a new index set implementation 52 53 Synopsis: 54 #include "petscis.h" 55 PetscErrorCode ISRegisterDynamic(const char *name, const char *path, const char *func_name, PetscErrorCode (*create_func)(IS)) 56 57 Not Collective 58 59 Input Parameters: 60 + name - The name of a new user-defined creation routine 61 . path - The path (either absolute or relative) of the library containing this routine 62 . func_name - The name of routine to create method context 63 - create_func - The creation routine itself 64 65 Notes: 66 ISRegisterDynamic() may be called multiple times to add several user-defined vectors 67 68 If dynamic libraries are used, then the fourth input argument (routine_create) is ignored. 69 70 Sample usage: 71 .vb 72 ISRegisterDynamic("my_is_name","/home/username/my_lib/lib/libO/solaris/libmy.a", "MyISCreate", MyISCreate); 73 .ve 74 75 Then, your vector type can be chosen with the procedural interface via 76 .vb 77 ISCreate(MPI_Comm, IS *); 78 ISSetType(IS,"my_is_name"); 79 .ve 80 or at runtime via the option 81 .vb 82 -is_type my_is_name 83 .ve 84 85 Notes: $PETSC_ARCH occuring in pathname will be replaced with appropriate values. 86 If your function is not being put into a shared library then use ISRegister() instead 87 88 This is no ISSetFromOptions() and the current implementations do not have a way to dynamically determine type, so 89 dynamic registration of custom IS types will be of limited use to users. 90 91 Level: developer 92 93 .keywords: IS, register 94 .seealso: ISRegisterAll(), ISRegisterDestroy(), ISRegister() 95 M*/ 96 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 97 #define ISRegisterDynamic(a,b,c,d) ISRegister(a,b,c,0) 98 #else 99 #define ISRegisterDynamic(a,b,c,d) ISRegister(a,b,c,d) 100 #endif 101 102 /* 103 Default index set data structures that PETSc provides. 104 */ 105 PETSC_EXTERN PetscErrorCode ISCreateGeneral(MPI_Comm,PetscInt,const PetscInt[],PetscCopyMode,IS *); 106 PETSC_EXTERN PetscErrorCode ISGeneralSetIndices(IS,PetscInt,const PetscInt[],PetscCopyMode); 107 PETSC_EXTERN PetscErrorCode ISCreateBlock(MPI_Comm,PetscInt,PetscInt,const PetscInt[],PetscCopyMode,IS *); 108 PETSC_EXTERN PetscErrorCode ISBlockSetIndices(IS,PetscInt,PetscInt,const PetscInt[],PetscCopyMode); 109 PETSC_EXTERN PetscErrorCode ISCreateStride(MPI_Comm,PetscInt,PetscInt,PetscInt,IS *); 110 PETSC_EXTERN PetscErrorCode ISStrideSetStride(IS,PetscInt,PetscInt,PetscInt); 111 112 PETSC_EXTERN PetscErrorCode ISDestroy(IS*); 113 PETSC_EXTERN PetscErrorCode ISSetPermutation(IS); 114 PETSC_EXTERN PetscErrorCode ISPermutation(IS,PetscBool *); 115 PETSC_EXTERN PetscErrorCode ISSetIdentity(IS); 116 PETSC_EXTERN PetscErrorCode ISIdentity(IS,PetscBool *); 117 PETSC_EXTERN PetscErrorCode ISContiguousLocal(IS,PetscInt,PetscInt,PetscInt*,PetscBool*); 118 119 PETSC_EXTERN PetscErrorCode ISGetIndices(IS,const PetscInt *[]); 120 PETSC_EXTERN PetscErrorCode ISRestoreIndices(IS,const PetscInt *[]); 121 PETSC_EXTERN PetscErrorCode ISGetTotalIndices(IS,const PetscInt *[]); 122 PETSC_EXTERN PetscErrorCode ISRestoreTotalIndices(IS,const PetscInt *[]); 123 PETSC_EXTERN PetscErrorCode ISGetNonlocalIndices(IS,const PetscInt *[]); 124 PETSC_EXTERN PetscErrorCode ISRestoreNonlocalIndices(IS,const PetscInt *[]); 125 PETSC_EXTERN PetscErrorCode ISGetNonlocalIS(IS, IS *is); 126 PETSC_EXTERN PetscErrorCode ISRestoreNonlocalIS(IS, IS *is); 127 PETSC_EXTERN PetscErrorCode ISGetSize(IS,PetscInt *); 128 PETSC_EXTERN PetscErrorCode ISGetLocalSize(IS,PetscInt *); 129 PETSC_EXTERN PetscErrorCode ISInvertPermutation(IS,PetscInt,IS*); 130 PETSC_EXTERN PetscErrorCode ISView(IS,PetscViewer); 131 PETSC_EXTERN PetscErrorCode ISEqual(IS,IS,PetscBool *); 132 PETSC_EXTERN PetscErrorCode ISSort(IS); 133 PETSC_EXTERN PetscErrorCode ISSorted(IS,PetscBool *); 134 PETSC_EXTERN PetscErrorCode ISDifference(IS,IS,IS*); 135 PETSC_EXTERN PetscErrorCode ISSum(IS,IS,IS*); 136 PETSC_EXTERN PetscErrorCode ISExpand(IS,IS,IS*); 137 PETSC_EXTERN PetscErrorCode ISGetMinMax(IS,PetscInt*,PetscInt*); 138 139 PETSC_EXTERN PetscErrorCode ISBlockGetIndices(IS,const PetscInt *[]); 140 PETSC_EXTERN PetscErrorCode ISBlockRestoreIndices(IS,const PetscInt *[]); 141 PETSC_EXTERN PetscErrorCode ISBlockGetLocalSize(IS,PetscInt *); 142 PETSC_EXTERN PetscErrorCode ISBlockGetSize(IS,PetscInt *); 143 PETSC_EXTERN PetscErrorCode ISGetBlockSize(IS,PetscInt*); 144 PETSC_EXTERN PetscErrorCode ISSetBlockSize(IS,PetscInt); 145 146 PETSC_EXTERN PetscErrorCode ISStrideGetInfo(IS,PetscInt *,PetscInt*); 147 148 PETSC_EXTERN PetscErrorCode ISToGeneral(IS); 149 150 PETSC_EXTERN PetscErrorCode ISDuplicate(IS,IS*); 151 PETSC_EXTERN PetscErrorCode ISCopy(IS,IS); 152 PETSC_EXTERN PetscErrorCode ISAllGather(IS,IS*); 153 PETSC_EXTERN PetscErrorCode ISComplement(IS,PetscInt,PetscInt,IS*); 154 PETSC_EXTERN PetscErrorCode ISConcatenate(MPI_Comm,PetscInt,const IS[],IS*); 155 PETSC_EXTERN PetscErrorCode ISListToPair(MPI_Comm,PetscInt, IS[],IS*,IS*); 156 PETSC_EXTERN PetscErrorCode ISPairToList(IS,IS,PetscInt*, IS *[]); 157 PETSC_EXTERN PetscErrorCode ISEmbed(IS,IS,PetscBool,IS*); 158 PETSC_EXTERN PetscErrorCode ISOnComm(IS,MPI_Comm,PetscCopyMode,IS*); 159 160 /* --------------------------------------------------------------------------*/ 161 PETSC_EXTERN PetscClassId IS_LTOGM_CLASSID; 162 163 /*S 164 ISLocalToGlobalMapping - mappings from an arbitrary 165 local ordering from 0 to n-1 to a global PETSc ordering 166 used by a vector or matrix. 167 168 Level: intermediate 169 170 Note: mapping from Local to Global is scalable; but Global 171 to Local may not be if the range of global values represented locally 172 is very large. 173 174 Note: the ISLocalToGlobalMapping is actually a private object; it is included 175 here for the inline function ISLocalToGlobalMappingApply() to allow it to be inlined since 176 it is used so often. 177 178 .seealso: ISLocalToGlobalMappingCreate() 179 S*/ 180 typedef struct _p_ISLocalToGlobalMapping* ISLocalToGlobalMapping; 181 182 /*E 183 ISGlobalToLocalMappingType - Indicates if missing global indices are 184 185 IS_GTOLM_MASK - missing global indices are replaced with -1 186 IS_GTOLM_DROP - missing global indices are dropped 187 188 Level: beginner 189 190 .seealso: ISGlobalToLocalMappingApply() 191 192 E*/ 193 typedef enum {IS_GTOLM_MASK,IS_GTOLM_DROP} ISGlobalToLocalMappingType; 194 195 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreate(MPI_Comm,PetscInt,const PetscInt[],PetscCopyMode,ISLocalToGlobalMapping*); 196 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreateIS(IS,ISLocalToGlobalMapping *); 197 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreateSF(PetscSF,PetscInt,ISLocalToGlobalMapping*); 198 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingView(ISLocalToGlobalMapping,PetscViewer); 199 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingDestroy(ISLocalToGlobalMapping*); 200 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingApplyIS(ISLocalToGlobalMapping,IS,IS*); 201 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingApply(ISLocalToGlobalMapping,PetscInt,const PetscInt[],PetscInt[]); 202 PETSC_EXTERN PetscErrorCode ISGlobalToLocalMappingApply(ISLocalToGlobalMapping,ISGlobalToLocalMappingType,PetscInt,const PetscInt[],PetscInt*,PetscInt[]); 203 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetSize(ISLocalToGlobalMapping,PetscInt*); 204 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]); 205 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]); 206 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetIndices(ISLocalToGlobalMapping,const PetscInt**); 207 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreIndices(ISLocalToGlobalMapping,const PetscInt**); 208 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingBlock(ISLocalToGlobalMapping,PetscInt,ISLocalToGlobalMapping*); 209 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingUnBlock(ISLocalToGlobalMapping,PetscInt,ISLocalToGlobalMapping*); 210 PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingConcatenate(MPI_Comm,PetscInt,const ISLocalToGlobalMapping[],ISLocalToGlobalMapping*); 211 PETSC_EXTERN PetscErrorCode ISG2LMapApply(ISLocalToGlobalMapping,PetscInt,const PetscInt[],PetscInt[]); 212 213 /* --------------------------------------------------------------------------*/ 214 /*E 215 ISColoringType - determines if the coloring is for the entire parallel grid/graph/matrix 216 or for just the local ghosted portion 217 218 Level: beginner 219 220 $ IS_COLORING_GLOBAL - does not include the colors for ghost points, this is used when the function 221 $ is called synchronously in parallel. This requires generating a "parallel coloring". 222 $ IS_COLORING_GHOSTED - includes colors for ghost points, this is used when the function can be called 223 $ seperately on individual processes with the ghost points already filled in. Does not 224 $ require a "parallel coloring", rather each process colors its local + ghost part. 225 $ Using this can result in much less parallel communication. In the paradigm of 226 $ DMGetLocalVector() and DMGetGlobalVector() this could be called IS_COLORING_LOCAL 227 228 .seealso: DMCreateColoring() 229 E*/ 230 typedef enum {IS_COLORING_GLOBAL,IS_COLORING_GHOSTED} ISColoringType; 231 PETSC_EXTERN const char *const ISColoringTypes[]; 232 typedef unsigned PETSC_IS_COLOR_VALUE_TYPE ISColoringValue; 233 PETSC_EXTERN PetscErrorCode ISAllGatherColors(MPI_Comm,PetscInt,ISColoringValue*,PetscInt*,ISColoringValue*[]); 234 235 /*S 236 ISColoring - sets of IS's that define a coloring 237 of the underlying indices 238 239 Level: intermediate 240 241 Notes: 242 One should not access the *is records below directly because they may not yet 243 have been created. One should use ISColoringGetIS() to make sure they are 244 created when needed. 245 246 Developer Note: this is not a PetscObject 247 248 .seealso: ISColoringCreate(), ISColoringGetIS(), ISColoringView(), ISColoringGetIS() 249 S*/ 250 struct _n_ISColoring { 251 PetscInt refct; 252 PetscInt n; /* number of colors */ 253 IS *is; /* for each color indicates columns */ 254 MPI_Comm comm; 255 ISColoringValue *colors; /* for each column indicates color */ 256 PetscInt N; /* number of columns */ 257 ISColoringType ctype; 258 }; 259 typedef struct _n_ISColoring* ISColoring; 260 261 PETSC_EXTERN PetscErrorCode ISColoringCreate(MPI_Comm,PetscInt,PetscInt,const ISColoringValue[],ISColoring*); 262 PETSC_EXTERN PetscErrorCode ISColoringDestroy(ISColoring*); 263 PETSC_EXTERN PetscErrorCode ISColoringView(ISColoring,PetscViewer); 264 PETSC_EXTERN PetscErrorCode ISColoringGetIS(ISColoring,PetscInt*,IS*[]); 265 PETSC_EXTERN PetscErrorCode ISColoringRestoreIS(ISColoring,IS*[]); 266 PETSC_EXTERN PetscErrorCode ISColoringReference(ISColoring); 267 PETSC_EXTERN PetscErrorCode ISColoringSetType(ISColoring,ISColoringType); 268 269 270 /* --------------------------------------------------------------------------*/ 271 272 PETSC_EXTERN PetscErrorCode ISPartitioningToNumbering(IS,IS*); 273 PETSC_EXTERN PetscErrorCode ISPartitioningCount(IS,PetscInt,PetscInt[]); 274 275 PETSC_EXTERN PetscErrorCode ISCompressIndicesGeneral(PetscInt,PetscInt,PetscInt,PetscInt,const IS[],IS[]); 276 PETSC_EXTERN PetscErrorCode ISCompressIndicesSorted(PetscInt,PetscInt,PetscInt,const IS[],IS[]); 277 PETSC_EXTERN PetscErrorCode ISExpandIndicesGeneral(PetscInt,PetscInt,PetscInt,PetscInt,const IS[],IS[]); 278 279 /*S 280 PetscLayout - defines layout of vectors and matrices across processes (which rows are owned by which processes) 281 282 Level: developer 283 284 285 .seealso: PetscLayoutCreate(), PetscLayoutDestroy() 286 S*/ 287 typedef struct _n_PetscLayout* PetscLayout; 288 struct _n_PetscLayout{ 289 MPI_Comm comm; 290 PetscInt n,N; /* local, global vector size */ 291 PetscInt rstart,rend; /* local start, local end + 1 */ 292 PetscInt *range; /* the offset of each processor */ 293 PetscInt bs; /* number of elements in each block (generally for multi-component problems) Do NOT multiply above numbers by bs */ 294 PetscInt refcnt; /* MPI Vecs obtained with VecDuplicate() and from MatGetVecs() reuse map of input object */ 295 ISLocalToGlobalMapping mapping; /* mapping used in Vec/MatSetValuesLocal() */ 296 ISLocalToGlobalMapping bmapping; /* mapping used in Vec/MatSetValuesBlockedLocal() */ 297 PetscInt *trstarts; /* local start for each thread */ 298 }; 299 300 PETSC_EXTERN PetscErrorCode PetscLayoutCreate(MPI_Comm,PetscLayout*); 301 PETSC_EXTERN PetscErrorCode PetscLayoutSetUp(PetscLayout); 302 PETSC_EXTERN PetscErrorCode PetscLayoutDestroy(PetscLayout*); 303 PETSC_EXTERN PetscErrorCode PetscLayoutDuplicate(PetscLayout,PetscLayout*); 304 PETSC_EXTERN PetscErrorCode PetscLayoutReference(PetscLayout,PetscLayout*); 305 PETSC_EXTERN PetscErrorCode PetscLayoutSetLocalSize(PetscLayout,PetscInt); 306 PETSC_EXTERN PetscErrorCode PetscLayoutGetLocalSize(PetscLayout,PetscInt *); 307 PETSC_EXTERN PetscErrorCode PetscLayoutSetSize(PetscLayout,PetscInt); 308 PETSC_EXTERN PetscErrorCode PetscLayoutGetSize(PetscLayout,PetscInt *); 309 PETSC_EXTERN PetscErrorCode PetscLayoutSetBlockSize(PetscLayout,PetscInt); 310 PETSC_EXTERN PetscErrorCode PetscLayoutGetBlockSize(PetscLayout,PetscInt*); 311 PETSC_EXTERN PetscErrorCode PetscLayoutGetRange(PetscLayout,PetscInt *,PetscInt *); 312 PETSC_EXTERN PetscErrorCode PetscLayoutGetRanges(PetscLayout,const PetscInt *[]); 313 PETSC_EXTERN PetscErrorCode PetscLayoutSetISLocalToGlobalMapping(PetscLayout,ISLocalToGlobalMapping); 314 PETSC_EXTERN PetscErrorCode PetscLayoutSetISLocalToGlobalMappingBlock(PetscLayout,ISLocalToGlobalMapping); 315 PETSC_EXTERN PetscErrorCode PetscSFSetGraphLayout(PetscSF,PetscLayout,PetscInt,const PetscInt*,PetscCopyMode,const PetscInt*); 316 317 #undef __FUNCT__ 318 #define __FUNCT__ "PetscLayoutFindOwner" 319 /*@C 320 PetscLayoutFindOwner - Find the owning rank for a global index 321 322 Not Collective 323 324 Input Parameters: 325 + map - the layout 326 - idx - global index to find the owner of 327 328 Output Parameter: 329 . owner - the owning rank 330 331 Level: developer 332 333 Fortran Notes: 334 Not available from Fortran 335 336 @*/ 337 PETSC_STATIC_INLINE PetscErrorCode PetscLayoutFindOwner(PetscLayout map,PetscInt idx,PetscInt *owner) 338 { 339 PetscErrorCode ierr; 340 PetscMPIInt lo = 0,hi,t; 341 342 PetscFunctionBegin; 343 *owner = -1; /* GCC erroneously issues warning about possibly uninitialized use when error condition */ 344 if (!((map->n >= 0) && (map->N >= 0) && (map->range))) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"PetscLayoutSetUp() must be called first"); 345 if (idx < 0 || idx > map->N) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Index %D is out of range",idx); 346 ierr = MPI_Comm_size(map->comm,&hi);CHKERRQ(ierr); 347 while (hi - lo > 1) { 348 t = lo + (hi - lo) / 2; 349 if (idx < map->range[t]) hi = t; 350 else lo = t; 351 } 352 *owner = lo; 353 PetscFunctionReturn(0); 354 } 355 356 #undef __FUNCT__ 357 #define __FUNCT__ "PetscLayoutFindOwnerIndex" 358 /*@C 359 PetscLayoutFindOwnerIndex - Find the owning rank and the local index for a global index 360 361 Not Collective 362 363 Input Parameters: 364 + map - the layout 365 - idx - global index to find the owner of 366 367 Output Parameter: 368 + owner - the owning rank 369 - lidx - local index used by the owner for idx 370 371 Level: developer 372 373 Fortran Notes: 374 Not available from Fortran 375 376 @*/ 377 PETSC_STATIC_INLINE PetscErrorCode PetscLayoutFindOwnerIndex(PetscLayout map,PetscInt idx,PetscInt *owner, PetscInt *lidx) 378 { 379 PetscErrorCode ierr; 380 PetscMPIInt lo = 0,hi,t; 381 382 PetscFunctionBegin; 383 if (!((map->n >= 0) && (map->N >= 0) && (map->range))) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"PetscLayoutSetUp() must be called first"); 384 if (idx < 0 || idx > map->N) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Index %D is out of range",idx); 385 ierr = MPI_Comm_size(map->comm,&hi);CHKERRQ(ierr); 386 while (hi - lo > 1) { 387 t = lo + (hi - lo) / 2; 388 if (idx < map->range[t]) hi = t; 389 else lo = t; 390 } 391 *owner = lo; 392 *lidx = idx-map->range[lo]; 393 PetscFunctionReturn(0); 394 } 395 396 /*S 397 PetscSection - This is a mapping from DMMESH points to sets of values, which is 398 our presentation of a fibre bundle. 399 400 Level: developer 401 402 .seealso: PetscSectionCreate(), PetscSectionDestroy() 403 S*/ 404 typedef struct _n_PetscSection *PetscSection; 405 PETSC_EXTERN PetscErrorCode PetscSectionCreate(MPI_Comm,PetscSection*); 406 PETSC_EXTERN PetscErrorCode PetscSectionClone(PetscSection, PetscSection*); 407 PETSC_EXTERN PetscErrorCode PetscSectionGetNumFields(PetscSection, PetscInt *); 408 PETSC_EXTERN PetscErrorCode PetscSectionSetNumFields(PetscSection, PetscInt); 409 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldName(PetscSection, PetscInt, const char *[]); 410 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldName(PetscSection, PetscInt, const char []); 411 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldComponents(PetscSection, PetscInt, PetscInt *); 412 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldComponents(PetscSection, PetscInt, PetscInt); 413 PETSC_EXTERN PetscErrorCode PetscSectionGetChart(PetscSection, PetscInt *, PetscInt *); 414 PETSC_EXTERN PetscErrorCode PetscSectionSetChart(PetscSection, PetscInt, PetscInt); 415 PETSC_EXTERN PetscErrorCode PetscSectionGetDof(PetscSection, PetscInt, PetscInt*); 416 PETSC_EXTERN PetscErrorCode PetscSectionSetDof(PetscSection, PetscInt, PetscInt); 417 PETSC_EXTERN PetscErrorCode PetscSectionAddDof(PetscSection, PetscInt, PetscInt); 418 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldDof(PetscSection, PetscInt, PetscInt, PetscInt*); 419 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldDof(PetscSection, PetscInt, PetscInt, PetscInt); 420 PETSC_EXTERN PetscErrorCode PetscSectionAddFieldDof(PetscSection, PetscInt, PetscInt, PetscInt); 421 PETSC_EXTERN PetscErrorCode PetscSectionGetConstraintDof(PetscSection, PetscInt, PetscInt*); 422 PETSC_EXTERN PetscErrorCode PetscSectionSetConstraintDof(PetscSection, PetscInt, PetscInt); 423 PETSC_EXTERN PetscErrorCode PetscSectionAddConstraintDof(PetscSection, PetscInt, PetscInt); 424 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldConstraintDof(PetscSection, PetscInt, PetscInt, PetscInt*); 425 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldConstraintDof(PetscSection, PetscInt, PetscInt, PetscInt); 426 PETSC_EXTERN PetscErrorCode PetscSectionAddFieldConstraintDof(PetscSection, PetscInt, PetscInt, PetscInt); 427 PETSC_EXTERN PetscErrorCode PetscSectionGetConstraintIndices(PetscSection, PetscInt, const PetscInt**); 428 PETSC_EXTERN PetscErrorCode PetscSectionSetConstraintIndices(PetscSection, PetscInt, const PetscInt*); 429 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldConstraintIndices(PetscSection, PetscInt, PetscInt, const PetscInt**); 430 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldConstraintIndices(PetscSection, PetscInt, PetscInt, const PetscInt*); 431 PETSC_EXTERN PetscErrorCode PetscSectionSetUpBC(PetscSection); 432 PETSC_EXTERN PetscErrorCode PetscSectionSetUp(PetscSection); 433 PETSC_EXTERN PetscErrorCode PetscSectionGetMaxDof(PetscSection, PetscInt*); 434 PETSC_EXTERN PetscErrorCode PetscSectionGetStorageSize(PetscSection, PetscInt*); 435 PETSC_EXTERN PetscErrorCode PetscSectionGetConstrainedStorageSize(PetscSection, PetscInt*); 436 PETSC_EXTERN PetscErrorCode PetscSectionGetOffset(PetscSection, PetscInt, PetscInt*); 437 PETSC_EXTERN PetscErrorCode PetscSectionSetOffset(PetscSection, PetscInt, PetscInt); 438 PETSC_EXTERN PetscErrorCode PetscSectionGetFieldOffset(PetscSection, PetscInt, PetscInt, PetscInt*); 439 PETSC_EXTERN PetscErrorCode PetscSectionSetFieldOffset(PetscSection, PetscInt, PetscInt, PetscInt); 440 PETSC_EXTERN PetscErrorCode PetscSectionGetOffsetRange(PetscSection, PetscInt *, PetscInt *); 441 PETSC_EXTERN PetscErrorCode PetscSectionView(PetscSection, PetscViewer); 442 PETSC_EXTERN PetscErrorCode PetscSectionReset(PetscSection); 443 PETSC_EXTERN PetscErrorCode PetscSectionDestroy(PetscSection*); 444 PETSC_EXTERN PetscErrorCode PetscSectionCreateGlobalSection(PetscSection, PetscSF, PetscBool, PetscSection *); 445 PETSC_EXTERN PetscErrorCode PetscSectionCreateGlobalSectionCensored(PetscSection, PetscSF, PetscBool, PetscInt, const PetscInt [], PetscSection *); 446 PETSC_EXTERN PetscErrorCode PetscSectionCreateSubsection(PetscSection, PetscInt, PetscInt [], PetscSection *); 447 PETSC_EXTERN PetscErrorCode PetscSectionCreateSubmeshSection(PetscSection, IS, PetscSection *); 448 PETSC_EXTERN PetscErrorCode PetscSectionGetPointLayout(MPI_Comm, PetscSection, PetscLayout *); 449 PETSC_EXTERN PetscErrorCode PetscSectionGetValueLayout(MPI_Comm, PetscSection, PetscLayout *); 450 451 /* PetscSF support */ 452 PETSC_EXTERN PetscErrorCode PetscSFConvertPartition(PetscSF, PetscSection, IS, ISLocalToGlobalMapping *, PetscSF *); 453 PETSC_EXTERN PetscErrorCode PetscSFCreateRemoteOffsets(PetscSF, PetscSection, PetscSection, PetscInt **); 454 PETSC_EXTERN PetscErrorCode PetscSFDistributeSection(PetscSF, PetscSection, PetscInt **, PetscSection); 455 PETSC_EXTERN PetscErrorCode PetscSFCreateSectionSF(PetscSF, PetscSection, PetscInt [], PetscSection, PetscSF *); 456 457 /* Reset __FUNCT__ in case the user does not define it themselves */ 458 #undef __FUNCT__ 459 #define __FUNCT__ "User provided function" 460 461 #endif 462