BUGFIX: Compile WM_LABEL_SIZE=64 (final). Author: Henrik Rusche.
This commit is contained in:
commit
396997c0ae
312 changed files with 1112 additions and 870 deletions
38
ThirdParty/rpmBuild/SOURCES/ParMGridGen-1.0.patch_64Bit
vendored
Normal file
38
ThirdParty/rpmBuild/SOURCES/ParMGridGen-1.0.patch_64Bit
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
--- orig/ParMGridGen-1.0/mgridgen.h 2019-01-15 13:32:54.247812378 +0100
|
||||||
|
+++ ParMGridGen-1.0/mgridgen.h 2019-01-15 13:35:03.972952464 +0100
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-typedef int idxtype;
|
||||||
|
+typedef long int idxtype;
|
||||||
|
typedef double realtype;
|
||||||
|
|
||||||
|
|
||||||
|
--- orig/ParMGridGen-1.0/parmgridgen.h 2019-01-15 13:32:54.251812414 +0100
|
||||||
|
+++ ParMGridGen-1.0/parmgridgen.h 2019-01-15 13:42:14.344335223 +0100
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-typedef int idxtype;
|
||||||
|
+typedef long int idxtype;
|
||||||
|
typedef double realtype;
|
||||||
|
|
||||||
|
void ParMGridGen(idxtype *, idxtype *, realtype *, realtype *, idxtype *,
|
||||||
|
--- orig/ParMGridGen-1.0/ParMGridGen/IMParMetis-2.0/ParMETISLib/struct.h 2019-01-15 13:32:54.247812378 +0100
|
||||||
|
+++ ParMGridGen-1.0/ParMGridGen/IMParMetis-2.0/ParMETISLib/struct.h 2019-01-15 13:44:17.605231500 +0100
|
||||||
|
@@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
/* Indexes are as long as integers for now */
|
||||||
|
#ifdef IDXTYPE_INT
|
||||||
|
-typedef int idxtype;
|
||||||
|
+typedef long int idxtype;
|
||||||
|
#define IDX_DATATYPE MPI_INT
|
||||||
|
#else
|
||||||
|
typedef short idxtype;
|
||||||
|
--- orig/ParMGridGen-1.0/MGridGen/IMlib/IMlib.h 2019-01-15 13:32:54.251812414 +0100
|
||||||
|
+++ ParMGridGen-1.0/MGridGen/IMlib/IMlib.h 2019-01-15 13:52:11.504522970 +0100
|
||||||
|
@@ -16,7 +16,7 @@
|
||||||
|
|
||||||
|
/* Indexes are as long as integers for now */
|
||||||
|
#ifdef IDXTYPE_INT
|
||||||
|
-typedef int idxtype;
|
||||||
|
+typedef long int idxtype;
|
||||||
|
#else
|
||||||
|
typedef short idxtype;
|
||||||
|
#endif
|
11
ThirdParty/rpmBuild/SOURCES/ParMetis-3.1.1.patch_64Bit
vendored
Normal file
11
ThirdParty/rpmBuild/SOURCES/ParMetis-3.1.1.patch_64Bit
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--- orig/parmetis-4.0.3/metis/include/metis.h 2019-01-15 12:40:31.050842343 +0100
|
||||||
|
+++ parmetis-4.0.3/metis/include/metis.h 2019-01-15 12:43:01.883662756 +0100
|
||||||
|
@@ -30,7 +30,7 @@
|
||||||
|
GCC does provides these definitions in stdint.h, but it may require some
|
||||||
|
modifications on other architectures.
|
||||||
|
--------------------------------------------------------------------------*/
|
||||||
|
-#define IDXTYPEWIDTH 32
|
||||||
|
+#define IDXTYPEWIDTH 64
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------
|
11
ThirdParty/rpmBuild/SOURCES/metis-5.1.0_patch_64Bit
vendored
Normal file
11
ThirdParty/rpmBuild/SOURCES/metis-5.1.0_patch_64Bit
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--- orig/metis-5.1.0/include/metis.h 2019-01-15 12:40:31.050842343 +0100
|
||||||
|
+++ metis-5.1.0/include/metis.h 2019-01-15 12:43:01.883662756 +0100
|
||||||
|
@@ -30,7 +30,7 @@
|
||||||
|
GCC does provides these definitions in stdint.h, but it may require some
|
||||||
|
modifications on other architectures.
|
||||||
|
--------------------------------------------------------------------------*/
|
||||||
|
-#define IDXTYPEWIDTH 32
|
||||||
|
+#define IDXTYPEWIDTH 64
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------
|
|
@ -27,14 +27,15 @@ diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_mac_darwin10.shlib sc
|
||||||
diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib
|
diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib
|
||||||
--- scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2014-08-05 08:56:17.000000000 -0400
|
--- scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2014-08-05 08:56:17.000000000 -0400
|
||||||
+++ scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2015-06-21 00:26:43.072992194 -0400
|
+++ scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2015-06-21 00:26:43.072992194 -0400
|
||||||
@@ -8,10 +8,10 @@
|
@@ -8,10 +8,11 @@
|
||||||
CAT = cat
|
CAT = cat
|
||||||
CCS = gcc
|
CCS = gcc
|
||||||
CCP = mpicc
|
CCP = mpicc
|
||||||
-CCD = gcc
|
-CCD = gcc
|
||||||
-CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict
|
-CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict
|
||||||
+CCD = mpicc -I$(MPI_HOME)/include
|
+CCD = mpicc -I$(MPI_HOME)/include
|
||||||
+CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -Xlinker --no-as-needed
|
+INTSIZE =
|
||||||
|
+CFLAGS = -O3 $(INTSIZE) -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -Xlinker --no-as-needed
|
||||||
CLIBFLAGS = -shared -fPIC
|
CLIBFLAGS = -shared -fPIC
|
||||||
-LDFLAGS = -lz -lm -pthread
|
-LDFLAGS = -lz -lm -pthread
|
||||||
+LDFLAGS = -lz -lm -pthread -lrt
|
+LDFLAGS = -lz -lm -pthread -lrt
|
||||||
|
|
12
ThirdParty/rpmBuild/SOURCES/scotch-6.0.4_patch_64Bit
vendored
Normal file
12
ThirdParty/rpmBuild/SOURCES/scotch-6.0.4_patch_64Bit
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib
|
||||||
|
--- orig/scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2019-01-15 11:26:39.142915259 +0100
|
||||||
|
+++ scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2019-01-15 11:26:58.871041175 +0100
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
CCS = gcc
|
||||||
|
CCP = mpicc
|
||||||
|
CCD = mpicc -I$(MPI_HOME)/include
|
||||||
|
-INTSIZE =
|
||||||
|
+INTSIZE = -DINTSIZE64
|
||||||
|
CFLAGS = -O3 $(INTSIZE) -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -Xlinker --no-as-needed
|
||||||
|
CLIBFLAGS = -shared -fPIC
|
||||||
|
LDFLAGS = -lz -lm -pthread -lrt
|
|
@ -78,6 +78,7 @@ Prefix: %{_prefix}
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
Patch0: ParMGridGen-1.0.patch_darwin
|
Patch0: ParMGridGen-1.0.patch_darwin
|
||||||
Patch1: ParMGridGen-1.0.patch
|
Patch1: ParMGridGen-1.0.patch
|
||||||
|
Patch2: ParMGridGen-1.0.patch_64Bit
|
||||||
|
|
||||||
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
||||||
|
|
||||||
|
@ -93,6 +94,10 @@ Patch1: ParMGridGen-1.0.patch
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
if [ "$WM_LABEL_SIZE" = "64" ]; then
|
||||||
|
%patch2 -p1
|
||||||
|
fi
|
||||||
|
|
||||||
%build
|
%build
|
||||||
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||||
|
|
5
ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec
vendored
5
ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec
vendored
|
@ -77,6 +77,7 @@ Source: %url/%{name}-%{version}.tar.gz
|
||||||
Prefix: %{_prefix}
|
Prefix: %{_prefix}
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
Patch0: metis-5.1.0_patch_gcc
|
Patch0: metis-5.1.0_patch_gcc
|
||||||
|
Patch1: metis-5.1.0_patch_64Bit
|
||||||
|
|
||||||
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
||||||
|
|
||||||
|
@ -90,6 +91,10 @@ Patch0: metis-5.1.0_patch_gcc
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
if [ "$WM_LABEL_SIZE" = "64" ]; then
|
||||||
|
%patch1 -p1
|
||||||
|
fi
|
||||||
|
|
||||||
%build
|
%build
|
||||||
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||||
|
|
|
@ -78,6 +78,7 @@ Prefix: %{_prefix}
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
Patch0: ParMetis-3.1.1.patch_darwin
|
Patch0: ParMetis-3.1.1.patch_darwin
|
||||||
Patch1: ParMetis-3.1.1.patch
|
Patch1: ParMetis-3.1.1.patch
|
||||||
|
Patch2: ParMetis-3.1.1.patch_64Bit
|
||||||
|
|
||||||
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
||||||
|
|
||||||
|
@ -93,6 +94,10 @@ Patch1: ParMetis-3.1.1.patch
|
||||||
#patch1 -p1
|
#patch1 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
if [ "$WM_LABEL_SIZE" = "64" ]; then
|
||||||
|
%patch2 -p1
|
||||||
|
fi
|
||||||
|
|
||||||
%build
|
%build
|
||||||
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||||
|
|
5
ThirdParty/rpmBuild/SPECS/scotch-6.0.4.spec
vendored
5
ThirdParty/rpmBuild/SPECS/scotch-6.0.4.spec
vendored
|
@ -77,6 +77,7 @@ Prefix: %{_prefix}
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
Patch0: scotch-6.0.4_patch_0
|
Patch0: scotch-6.0.4_patch_0
|
||||||
Patch1: scotch-6.0.4_patch_darwin
|
Patch1: scotch-6.0.4_patch_darwin
|
||||||
|
Patch2: scotch-6.0.4_patch_64Bit
|
||||||
|
|
||||||
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
|
||||||
|
|
||||||
|
@ -92,6 +93,10 @@ Patch1: scotch-6.0.4_patch_darwin
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
if [ "$WM_LABEL_SIZE" = "64" ]; then
|
||||||
|
%patch2 -p1
|
||||||
|
fi
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# export WM settings in a form that GNU configure recognizes
|
# export WM settings in a form that GNU configure recognizes
|
||||||
# [ -n "$WM_CC" ] && export CC="$WM_CC"
|
# [ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
||||||
PtrList<volScalarField> DpDtFluid(fluidRegions.size());
|
PtrList<volScalarField> DpDtFluid(fluidRegions.size());
|
||||||
|
|
||||||
List<scalar> initialMassFluid(fluidRegions.size());
|
scalarList initialMassFluid(fluidRegions.size());
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
|
|
|
@ -54,10 +54,10 @@ class regionProperties
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- List of the fluid region names
|
//- List of the fluid region names
|
||||||
List<word> fluidRegionNames_;
|
wordList fluidRegionNames_;
|
||||||
|
|
||||||
//- List of the solid region names
|
//- List of the solid region names
|
||||||
List<word> solidRegionNames_;
|
wordList solidRegionNames_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
@ -87,10 +87,10 @@ public:
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return const reference to the list of fluid region names
|
//- Return const reference to the list of fluid region names
|
||||||
const List<word>& fluidRegionNames() const;
|
const wordList& fluidRegionNames() const;
|
||||||
|
|
||||||
//- Return const reference to the list of solid region names
|
//- Return const reference to the list of solid region names
|
||||||
const List<word>& solidRegionNames() const;
|
const wordList& solidRegionNames() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
||||||
PtrList<volScalarField> DpDtf(fluidRegions.size());
|
PtrList<volScalarField> DpDtf(fluidRegions.size());
|
||||||
|
|
||||||
List<scalar> initialMassFluid(fluidRegions.size());
|
scalarList initialMassFluid(fluidRegions.size());
|
||||||
List<label> pRefCellFluid(fluidRegions.size(),0);
|
labelList pRefCellFluid(fluidRegions.size(),0);
|
||||||
List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
|
scalarList pRefValueFluid(fluidRegions.size(),0.0);
|
||||||
|
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
|
|
|
@ -60,7 +60,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList facesToBreak(facesToBreakList);
|
labelList facesToBreak(facesToBreakList);
|
||||||
List<scalar> facesToBreakEffTractionFraction
|
scalarList facesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
facesToBreakEffTractionFractionList
|
facesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
@ -192,7 +192,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
||||||
List<scalar> coupledFacesToBreakEffTractionFraction
|
scalarList coupledFacesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
coupledFacesToBreakEffTractionFractionList
|
coupledFacesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
|
|
@ -62,7 +62,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList facesToBreak(facesToBreakList);
|
labelList facesToBreak(facesToBreakList);
|
||||||
List<scalar> facesToBreakEffTractionFraction
|
scalarList facesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
facesToBreakEffTractionFractionList
|
facesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
@ -197,7 +197,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
||||||
List<scalar> coupledFacesToBreakEffTractionFraction
|
scalarList coupledFacesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
coupledFacesToBreakEffTractionFractionList
|
coupledFacesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
|
|
@ -60,7 +60,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList facesToBreak(facesToBreakList);
|
labelList facesToBreak(facesToBreakList);
|
||||||
List<scalar> facesToBreakEffTractionFraction
|
scalarList facesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
facesToBreakEffTractionFractionList
|
facesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
@ -192,7 +192,7 @@ nCoupledFacesToBreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
labelList coupledFacesToBreak(coupledFacesToBreakList);
|
||||||
List<scalar> coupledFacesToBreakEffTractionFraction
|
scalarList coupledFacesToBreakEffTractionFraction
|
||||||
(
|
(
|
||||||
coupledFacesToBreakEffTractionFractionList
|
coupledFacesToBreakEffTractionFractionList
|
||||||
);
|
);
|
||||||
|
|
|
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
label curMeshEdge = meshEdges[edgeI];
|
label curMeshEdge = meshEdges[edgeI];
|
||||||
|
|
||||||
labelList curEdgePatchIDs(2, -1);
|
labelList curEdgePatchIDs(2, label(-1));
|
||||||
|
|
||||||
label patchI = -1;
|
label patchI = -1;
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Mark cut edges.
|
// Mark cut edges.
|
||||||
|
|
||||||
DynamicList<label> allCutEdges(pp.nEdges());
|
dynamicLabelList allCutEdges(pp.nEdges());
|
||||||
|
|
||||||
DynamicList<scalar> allCutEdgeWeights(pp.nEdges());
|
DynamicList<scalar> allCutEdgeWeights(pp.nEdges());
|
||||||
|
|
||||||
|
|
|
@ -117,14 +117,14 @@ int main(int argc, char *argv[])
|
||||||
SortableList<scalar> sortedVols(vols);
|
SortableList<scalar> sortedVols(vols);
|
||||||
|
|
||||||
// All cell labels, sorted per bin.
|
// All cell labels, sorted per bin.
|
||||||
DynamicList<DynamicList<label> > bins;
|
DynamicList<dynamicLabelList > bins;
|
||||||
|
|
||||||
// Lower/upper limits
|
// Lower/upper limits
|
||||||
DynamicList<scalar> lowerLimits;
|
DynamicList<scalar> lowerLimits;
|
||||||
DynamicList<scalar> upperLimits;
|
DynamicList<scalar> upperLimits;
|
||||||
|
|
||||||
// Create bin0. Have upperlimit as factor times lowerlimit.
|
// Create bin0. Have upperlimit as factor times lowerlimit.
|
||||||
bins.append(DynamicList<label>());
|
bins.append(dynamicLabelList());
|
||||||
lowerLimits.append(sortedVols[0]);
|
lowerLimits.append(sortedVols[0]);
|
||||||
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ int main(int argc, char *argv[])
|
||||||
// New value outside of current bin
|
// New value outside of current bin
|
||||||
|
|
||||||
// Shrink old bin.
|
// Shrink old bin.
|
||||||
DynamicList<label>& bin = bins[bins.size()-1];
|
dynamicLabelList& bin = bins[bins.size()-1];
|
||||||
|
|
||||||
bin.shrink();
|
bin.shrink();
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
||||||
<< upperLimits[upperLimits.size()-1] << endl;
|
<< upperLimits[upperLimits.size()-1] << endl;
|
||||||
|
|
||||||
// Create new bin.
|
// Create new bin.
|
||||||
bins.append(DynamicList<label>());
|
bins.append(dynamicLabelList());
|
||||||
lowerLimits.append(sortedVols[i]);
|
lowerLimits.append(sortedVols[i]);
|
||||||
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append to current bin.
|
// Append to current bin.
|
||||||
DynamicList<label>& bin = bins[bins.size()-1];
|
dynamicLabelList& bin = bins[bins.size()-1];
|
||||||
|
|
||||||
bin.append(sortedVols.indices()[i]);
|
bin.append(sortedVols.indices()[i]);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ int main(int argc, char *argv[])
|
||||||
Info<< "Volume bins:" << nl;
|
Info<< "Volume bins:" << nl;
|
||||||
forAll(bins, binI)
|
forAll(bins, binI)
|
||||||
{
|
{
|
||||||
const DynamicList<label>& bin = bins[binI];
|
const dynamicLabelList& bin = bins[binI];
|
||||||
|
|
||||||
cellSet cells(mesh, "vol" + name(binI), bin.size());
|
cellSet cells(mesh, "vol" + name(binI), bin.size());
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ int main(int argc, char *argv[])
|
||||||
// Set cell values
|
// Set cell values
|
||||||
forAll(bins, binI)
|
forAll(bins, binI)
|
||||||
{
|
{
|
||||||
const DynamicList<label>& bin = bins[binI];
|
const dynamicLabelList& bin = bins[binI];
|
||||||
|
|
||||||
forAll(bin, i)
|
forAll(bin, i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,7 +256,7 @@ label selectOutsideCells
|
||||||
|
|
||||||
// Outside faces
|
// Outside faces
|
||||||
labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2);
|
labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2);
|
||||||
DynamicList<label> outsideFaces(outsideFacesMap.size());
|
dynamicLabelList outsideFaces(outsideFacesMap.size());
|
||||||
// CellInfo on outside faces
|
// CellInfo on outside faces
|
||||||
DynamicList<cellInfo> outsideFacesInfo(outsideFacesMap.size());
|
DynamicList<cellInfo> outsideFacesInfo(outsideFacesMap.size());
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool splitHex
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
|
|
||||||
DynamicList<label>& cutCells,
|
dynamicLabelList& cutCells,
|
||||||
DynamicList<labelList>& cellLoops,
|
DynamicList<labelList>& cellLoops,
|
||||||
DynamicList<scalarField>& cellEdgeWeights
|
DynamicList<scalarField>& cellEdgeWeights
|
||||||
)
|
)
|
||||||
|
@ -306,7 +306,7 @@ bool splitCell
|
||||||
const boolList& edgeIsCut,
|
const boolList& edgeIsCut,
|
||||||
const scalarField& edgeWeight,
|
const scalarField& edgeWeight,
|
||||||
|
|
||||||
DynamicList<label>& cutCells,
|
dynamicLabelList& cutCells,
|
||||||
DynamicList<labelList>& cellLoops,
|
DynamicList<labelList>& cellLoops,
|
||||||
DynamicList<scalarField>& cellEdgeWeights
|
DynamicList<scalarField>& cellEdgeWeights
|
||||||
)
|
)
|
||||||
|
@ -369,7 +369,7 @@ void collectCuts
|
||||||
const scalar minSin,
|
const scalar minSin,
|
||||||
const cellSet& cellsToCut,
|
const cellSet& cellsToCut,
|
||||||
|
|
||||||
DynamicList<label>& cutCells,
|
dynamicLabelList& cutCells,
|
||||||
DynamicList<labelList>& cellLoops,
|
DynamicList<labelList>& cellLoops,
|
||||||
DynamicList<scalarField>& cellEdgeWeights
|
DynamicList<scalarField>& cellEdgeWeights
|
||||||
)
|
)
|
||||||
|
@ -600,7 +600,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
|
|
||||||
// Cut information per cut cell
|
// Cut information per cut cell
|
||||||
DynamicList<label> cutCells(mesh.nCells()/10 + 10);
|
dynamicLabelList cutCells(mesh.nCells()/10 + 10);
|
||||||
DynamicList<labelList> cellLoops(mesh.nCells()/10 + 10);
|
DynamicList<labelList> cellLoops(mesh.nCells()/10 + 10);
|
||||||
DynamicList<scalarField> cellEdgeWeights(mesh.nCells()/10 + 10);
|
DynamicList<scalarField> cellEdgeWeights(mesh.nCells()/10 + 10);
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ void storeCellInZone
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label cellType,
|
const label cellType,
|
||||||
Map<label>& typeToZone,
|
Map<label>& typeToZone,
|
||||||
List<DynamicList<label> >& zoneCells
|
List<dynamicLabelList >& zoneCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (cellType >= 0)
|
if (cellType >= 0)
|
||||||
|
@ -389,8 +389,8 @@ void ReadCells
|
||||||
labelList& foamCellMap,
|
labelList& foamCellMap,
|
||||||
labelList& foamCellType,
|
labelList& foamCellType,
|
||||||
Map<label>& prostarToFoamPatch,
|
Map<label>& prostarToFoamPatch,
|
||||||
DynamicList<label>& foamPatchSizes,
|
dynamicLabelList& foamPatchSizes,
|
||||||
DynamicList<label>& foamPatchStarts,
|
dynamicLabelList& foamPatchStarts,
|
||||||
labelList& foamFaceMap,
|
labelList& foamFaceMap,
|
||||||
labelList& foamOwner,
|
labelList& foamOwner,
|
||||||
labelList& foamNeighbour,
|
labelList& foamNeighbour,
|
||||||
|
@ -599,8 +599,8 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Patching info
|
// Patching info
|
||||||
Map<label> prostarToFoamPatch;
|
Map<label> prostarToFoamPatch;
|
||||||
DynamicList<label> foamPatchSizes;
|
dynamicLabelList foamPatchSizes;
|
||||||
DynamicList<label> foamPatchStarts;
|
dynamicLabelList foamPatchStarts;
|
||||||
// Face connectivity
|
// Face connectivity
|
||||||
labelList foamFaceMap;
|
labelList foamFaceMap;
|
||||||
labelList foamOwner;
|
labelList foamOwner;
|
||||||
|
@ -1008,7 +1008,7 @@ int main(int argc, char *argv[])
|
||||||
// From foamCellType physical region to Foam cellZone
|
// From foamCellType physical region to Foam cellZone
|
||||||
Map<label> typeToZone;
|
Map<label> typeToZone;
|
||||||
// Storage for cell zones.
|
// Storage for cell zones.
|
||||||
List<DynamicList<label> > zoneCells(0);
|
List<dynamicLabelList > zoneCells(0);
|
||||||
|
|
||||||
forAll(foamCellType, cellI)
|
forAll(foamCellType, cellI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ Description
|
||||||
|
|
||||||
#include "cellShapeRecognition.H"
|
#include "cellShapeRecognition.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
|
#include "boolList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -143,7 +144,7 @@ cellShape create3DCellShape
|
||||||
labelList pointLabels(curModel.nPoints(), -1);
|
labelList pointLabels(curModel.nPoints(), -1);
|
||||||
|
|
||||||
// Follow the used mesh faces
|
// Follow the used mesh faces
|
||||||
List<bool> meshFaceUsed(localFaces.size(), false);
|
boolList meshFaceUsed(localFaces.size(), false);
|
||||||
|
|
||||||
// Get the raw model faces
|
// Get the raw model faces
|
||||||
const faceList& modelFaces = curModel.modelFaces();
|
const faceList& modelFaces = curModel.modelFaces();
|
||||||
|
|
|
@ -99,7 +99,11 @@ int main(int argc, char *argv[])
|
||||||
const labelList faceOwner = mesh.faceOwner();
|
const labelList faceOwner = mesh.faceOwner();
|
||||||
const vectorField faceNormals = mesh.Sf()/mesh.magSf();
|
const vectorField faceNormals = mesh.Sf()/mesh.magSf();
|
||||||
|
|
||||||
labelListList abaqusCellPoints(cellPoints.size(), List<label>(8, 1));
|
labelListList abaqusCellPoints
|
||||||
|
(
|
||||||
|
cellPoints.size(),
|
||||||
|
labelList(8, label(1))
|
||||||
|
);
|
||||||
|
|
||||||
forAll(cells, celli)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
|
@ -338,7 +342,11 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
labelListList materialsOrdered(numberOfMaterials, List<label>(0,0));
|
labelListList materialsOrdered
|
||||||
|
(
|
||||||
|
numberOfMaterials,
|
||||||
|
labelList(0, label(0))
|
||||||
|
);
|
||||||
forAll(materialsOrdered, matOrderi)
|
forAll(materialsOrdered, matOrderi)
|
||||||
{
|
{
|
||||||
materialsOrdered[matOrderi].setSize(cellsOfEachMaterial[matOrderi], 0);
|
materialsOrdered[matOrderi].setSize(cellsOfEachMaterial[matOrderi], 0);
|
||||||
|
@ -401,7 +409,7 @@ int main(int argc, char *argv[])
|
||||||
//- face 5 is nodes 3 7 8 4
|
//- face 5 is nodes 3 7 8 4
|
||||||
//- face 6 is nodes 4 8 5 1
|
//- face 6 is nodes 4 8 5 1
|
||||||
//- So i will compare points on the face and
|
//- So i will compare points on the face and
|
||||||
labelListList abaqusFaceConvention(6, List<label>(4,-1));
|
labelListList abaqusFaceConvention(6, labelList(4, label(-1)));
|
||||||
abaqusFaceConvention[0][0] = 1;
|
abaqusFaceConvention[0][0] = 1;
|
||||||
abaqusFaceConvention[0][1] = 2;
|
abaqusFaceConvention[0][1] = 2;
|
||||||
abaqusFaceConvention[0][2] = 3;
|
abaqusFaceConvention[0][2] = 3;
|
||||||
|
@ -438,7 +446,7 @@ int main(int argc, char *argv[])
|
||||||
//- face it is
|
//- face it is
|
||||||
const labelList& facePoints = mesh.boundaryMesh()[patchi][facei];
|
const labelList& facePoints = mesh.boundaryMesh()[patchi][facei];
|
||||||
const labelList& thisCellAbaqusPoints = abaqusCellPoints[globalCelli];
|
const labelList& thisCellAbaqusPoints = abaqusCellPoints[globalCelli];
|
||||||
labelList thisFaceAbaqusPoints(4,-1);
|
labelList thisFaceAbaqusPoints(4, label(-1));
|
||||||
label pointsFound = 0;
|
label pointsFound = 0;
|
||||||
forAll(thisCellAbaqusPoints, pointi)
|
forAll(thisCellAbaqusPoints, pointi)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,7 +206,7 @@ void storeCellInZone
|
||||||
Map<label>& physToZone,
|
Map<label>& physToZone,
|
||||||
|
|
||||||
labelList& zoneToPhys,
|
labelList& zoneToPhys,
|
||||||
List<DynamicList<label> >& zoneCells
|
List<dynamicLabelList >& zoneCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Map<label>::const_iterator zoneFnd = physToZone.find(regPhys);
|
Map<label>::const_iterator zoneFnd = physToZone.find(regPhys);
|
||||||
|
@ -373,7 +373,7 @@ void readCells
|
||||||
List<DynamicList<face> >& patchFaces,
|
List<DynamicList<face> >& patchFaces,
|
||||||
|
|
||||||
labelList& zoneToPhys,
|
labelList& zoneToPhys,
|
||||||
List<DynamicList<label> >& zoneCells
|
List<dynamicLabelList >& zoneCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< "Starting to read cells at line " << inFile.lineNumber() << endl;
|
Info<< "Starting to read cells at line " << inFile.lineNumber() << endl;
|
||||||
|
@ -786,7 +786,7 @@ int main(int argc, char *argv[])
|
||||||
// Map from cellZone to gmsh physical region
|
// Map from cellZone to gmsh physical region
|
||||||
labelList zoneToPhys;
|
labelList zoneToPhys;
|
||||||
// Storage for cell zones.
|
// Storage for cell zones.
|
||||||
List<DynamicList<label> > zoneCells(0);
|
List<dynamicLabelList > zoneCells(0);
|
||||||
|
|
||||||
// Name per physical region
|
// Name per physical region
|
||||||
Map<word> physicalNames;
|
Map<word> physicalNames;
|
||||||
|
@ -933,7 +933,7 @@ int main(int argc, char *argv[])
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[mesh.boundaryMesh().size()-1];
|
const polyPatch& pp = mesh.boundaryMesh()[mesh.boundaryMesh().size()-1];
|
||||||
|
|
||||||
// Storage for faceZones.
|
// Storage for faceZones.
|
||||||
List<DynamicList<label> > zoneFaces(patchFaces.size());
|
List<dynamicLabelList > zoneFaces(patchFaces.size());
|
||||||
|
|
||||||
|
|
||||||
// Go through all the patchFaces and find corresponding face in pp.
|
// Go through all the patchFaces and find corresponding face in pp.
|
||||||
|
|
|
@ -185,7 +185,7 @@ void readPoints
|
||||||
(
|
(
|
||||||
IFstream& is,
|
IFstream& is,
|
||||||
DynamicList<point>& points, // coordinates
|
DynamicList<point>& points, // coordinates
|
||||||
DynamicList<label>& unvPointID // unv index
|
dynamicLabelList& unvPointID // unv index
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Sout<< "Starting reading points at line " << is.lineNumber() << '.' << endl;
|
Sout<< "Starting reading points at line " << is.lineNumber() << '.' << endl;
|
||||||
|
@ -210,7 +210,7 @@ void readPoints
|
||||||
IOWarningIn
|
IOWarningIn
|
||||||
(
|
(
|
||||||
"readPoints(IFstream&, label&, DynamicList<point>"
|
"readPoints(IFstream&, label&, DynamicList<point>"
|
||||||
", DynamicList<label>&)",
|
", dynamicLabelList&)",
|
||||||
is
|
is
|
||||||
) << "Points not in order starting at point " << pointI
|
) << "Points not in order starting at point " << pointI
|
||||||
//<< " at line " << is.lineNumber()
|
//<< " at line " << is.lineNumber()
|
||||||
|
@ -242,8 +242,8 @@ void readCells
|
||||||
(
|
(
|
||||||
IFstream& is,
|
IFstream& is,
|
||||||
DynamicList<cellShape>& cellVerts,
|
DynamicList<cellShape>& cellVerts,
|
||||||
DynamicList<label>& cellMaterial,
|
dynamicLabelList& cellMaterial,
|
||||||
DynamicList<label>& boundaryFaceIndices,
|
dynamicLabelList& boundaryFaceIndices,
|
||||||
DynamicList<face>& boundaryFaces
|
DynamicList<face>& boundaryFaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +514,7 @@ void readDOFS
|
||||||
<< " trying to read vertex indices."
|
<< " trying to read vertex indices."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
DynamicList<label> vertices;
|
dynamicLabelList vertices;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
string line;
|
string line;
|
||||||
|
@ -604,14 +604,14 @@ int main(int argc, char *argv[])
|
||||||
// Points
|
// Points
|
||||||
DynamicList<point> points;
|
DynamicList<point> points;
|
||||||
// Original unv point label
|
// Original unv point label
|
||||||
DynamicList<label> unvPointID;
|
dynamicLabelList unvPointID;
|
||||||
|
|
||||||
// Cells
|
// Cells
|
||||||
DynamicList<cellShape> cellVerts;
|
DynamicList<cellShape> cellVerts;
|
||||||
DynamicList<label> cellMat;
|
dynamicLabelList cellMat;
|
||||||
|
|
||||||
// Boundary faces
|
// Boundary faces
|
||||||
DynamicList<label> boundaryFaceIndices;
|
dynamicLabelList boundaryFaceIndices;
|
||||||
DynamicList<face> boundaryFaces;
|
DynamicList<face> boundaryFaces;
|
||||||
|
|
||||||
// Patch names and patchFace indices.
|
// Patch names and patchFace indices.
|
||||||
|
|
|
@ -212,7 +212,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||||
const bool edgeOrder,
|
const bool edgeOrder,
|
||||||
const label dualCell0,
|
const label dualCell0,
|
||||||
const label dualCell1,
|
const label dualCell1,
|
||||||
const DynamicList<label>& verts,
|
const dynamicLabelList& verts,
|
||||||
directTopoChange& meshMod
|
directTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
@ -330,7 +330,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
||||||
|
|
||||||
const label dualCellI,
|
const label dualCellI,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const DynamicList<label>& verts,
|
const dynamicLabelList& verts,
|
||||||
directTopoChange& meshMod
|
directTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
@ -423,7 +423,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
// Walk and collect face.
|
// Walk and collect face.
|
||||||
DynamicList<label> verts(100);
|
dynamicLabelList verts(100);
|
||||||
|
|
||||||
if (edgeToDualPoint_[edgeI] != -1)
|
if (edgeToDualPoint_[edgeI] != -1)
|
||||||
{
|
{
|
||||||
|
@ -571,7 +571,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
||||||
|
|
||||||
|
|
||||||
// Walk and collect face.
|
// Walk and collect face.
|
||||||
DynamicList<label> verts(100);
|
dynamicLabelList verts(100);
|
||||||
|
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[faceI]);
|
||||||
verts.append(edgeToDualPoint_[fEdges[fp]]);
|
verts.append(edgeToDualPoint_[fEdges[fp]]);
|
||||||
|
@ -672,7 +672,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||||
// Starting face
|
// Starting face
|
||||||
label faceI = startFaceI;
|
label faceI = startFaceI;
|
||||||
|
|
||||||
DynamicList<label> verts(4);
|
dynamicLabelList verts(4);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -770,7 +770,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||||
label faceI = startFaceI;
|
label faceI = startFaceI;
|
||||||
|
|
||||||
// Storage for face
|
// Storage for face
|
||||||
DynamicList<label> verts(mesh_.faces()[faceI].size());
|
dynamicLabelList verts(mesh_.faces()[faceI].size());
|
||||||
|
|
||||||
// Starting point.
|
// Starting point.
|
||||||
verts.append(pointToDualPoint_[pointI]);
|
verts.append(pointToDualPoint_[pointI]);
|
||||||
|
|
|
@ -47,7 +47,7 @@ SourceFiles
|
||||||
#ifndef meshDualiser_H
|
#ifndef meshDualiser_H
|
||||||
#define meshDualiser_H
|
#define meshDualiser_H
|
||||||
|
|
||||||
#include "DynamicList.H"
|
#include "dynamicLabelList.H"
|
||||||
#include "PackedBoolList.H"
|
#include "PackedBoolList.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
|
@ -122,7 +122,7 @@ class meshDualiser
|
||||||
const bool edgeOrder,
|
const bool edgeOrder,
|
||||||
const label dualCell0,
|
const label dualCell0,
|
||||||
const label dualCell1,
|
const label dualCell1,
|
||||||
const DynamicList<label>& verts,
|
const dynamicLabelList& verts,
|
||||||
directTopoChange& meshMod
|
directTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class meshDualiser
|
||||||
|
|
||||||
const label dualCellI,
|
const label dualCellI,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const DynamicList<label>& verts,
|
const dynamicLabelList& verts,
|
||||||
directTopoChange& meshMod
|
directTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ void sammMesh::readBoundary()
|
||||||
labelList pointLabels(4);
|
labelList pointLabels(4);
|
||||||
labelList pointLabelsTri(3);
|
labelList pointLabelsTri(3);
|
||||||
|
|
||||||
labelList patchLabels(1000, -1);
|
labelList patchLabels(1000, label(-1));
|
||||||
|
|
||||||
word patchType;
|
word patchType;
|
||||||
patchTypes_.setSize(1000);
|
patchTypes_.setSize(1000);
|
||||||
|
|
|
@ -230,7 +230,7 @@ void sammMesh::readCells()
|
||||||
{
|
{
|
||||||
IFstream cellsFile(cellsFileName);
|
IFstream cellsFile(cellsFileName);
|
||||||
|
|
||||||
labelList labels(24, -1);
|
labelList labels(24, label(-1));
|
||||||
label lineLabel, sammLabel, regionLabel, typeFlag;
|
label lineLabel, sammLabel, regionLabel, typeFlag;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label cellI = 0; cellI < nCells; cellI++)
|
||||||
|
|
|
@ -290,7 +290,7 @@ void writeCells(const polyMesh& mesh, const fileName& timeName)
|
||||||
const labelList & cFaces = cells[cellId];
|
const labelList & cFaces = cells[cellId];
|
||||||
|
|
||||||
// create (beg,end) indices
|
// create (beg,end) indices
|
||||||
List<label> indices(cFaces.size() + 1);
|
labelList indices(cFaces.size() + 1);
|
||||||
indices[0] = indices.size();
|
indices[0] = indices.size();
|
||||||
|
|
||||||
label count = indices.size();
|
label count = indices.size();
|
||||||
|
|
|
@ -47,7 +47,7 @@ void starMesh::readBoundary()
|
||||||
labelList pointLabels(4);
|
labelList pointLabels(4);
|
||||||
labelList pointLabelsTri(3);
|
labelList pointLabelsTri(3);
|
||||||
|
|
||||||
labelList patchLabels(1000, -1);
|
labelList patchLabels(1000, label(-1));
|
||||||
|
|
||||||
word patchType;
|
word patchType;
|
||||||
patchTypes_.setSize(1000);
|
patchTypes_.setSize(1000);
|
||||||
|
|
|
@ -275,7 +275,7 @@ void starMesh::readCells()
|
||||||
{
|
{
|
||||||
IFstream cellsFile(cellsFileName);
|
IFstream cellsFile(cellsFileName);
|
||||||
|
|
||||||
labelList labels(24, -1);
|
labelList labels(24, label(-1));
|
||||||
label lineLabel, starLabel, regionLabel, typeFlag;
|
label lineLabel, starLabel, regionLabel, typeFlag;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label cellI = 0; cellI < nCells; cellI++)
|
||||||
|
|
|
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
||||||
HashTable<label> zoneMap(nZones);
|
HashTable<label> zoneMap(nZones);
|
||||||
|
|
||||||
// Cells per zone.
|
// Cells per zone.
|
||||||
List<DynamicList<label> > zoneCells(nZones);
|
List<dynamicLabelList > zoneCells(nZones);
|
||||||
|
|
||||||
// Running cell counter
|
// Running cell counter
|
||||||
label cellI = 0;
|
label cellI = 0;
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
HashTable<label> zoneMap(nZones);
|
HashTable<label> zoneMap(nZones);
|
||||||
|
|
||||||
// Cells per zone.
|
// Cells per zone.
|
||||||
List<DynamicList<label> > zoneCells(nZones);
|
List<dynamicLabelList > zoneCells(nZones);
|
||||||
|
|
||||||
// Running cell counter
|
// Running cell counter
|
||||||
label cellI = 0;
|
label cellI = 0;
|
||||||
|
|
|
@ -397,7 +397,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Write patches
|
// Write patches
|
||||||
// Create patch addressing
|
// Create patch addressing
|
||||||
List<DynamicList<label> > patchAddr(patches.size());
|
List<dynamicLabelList > patchAddr(patches.size());
|
||||||
|
|
||||||
forAll(facets, faceI)
|
forAll(facets, faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ void getPatchIds
|
||||||
(
|
(
|
||||||
const triSurf& origSurf,
|
const triSurf& origSurf,
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
DynamicList<label>& patchIds
|
dynamicLabelList& patchIds
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const geometricSurfacePatchList& origPatches = origSurf.patches();
|
const geometricSurfacePatchList& origPatches = origSurf.patches();
|
||||||
|
@ -189,7 +189,7 @@ autoPtr<triSurf> mergeSurfacePatches
|
||||||
word newPatchType = origPatches[patchIds[0]].geometricType();
|
word newPatchType = origPatches[patchIds[0]].geometricType();
|
||||||
|
|
||||||
// Create patch addressing
|
// Create patch addressing
|
||||||
List<DynamicList<label> > patchAddr(origPatches.size()+1);
|
List<dynamicLabelList > patchAddr(origPatches.size()+1);
|
||||||
|
|
||||||
forAll(origFacets, faceI)
|
forAll(origFacets, faceI)
|
||||||
{
|
{
|
||||||
|
@ -331,7 +331,7 @@ int main(int argc, char *argv[])
|
||||||
triSurf origSurf(inFileName);
|
triSurf origSurf(inFileName);
|
||||||
|
|
||||||
// Get patch ids
|
// Get patch ids
|
||||||
DynamicList<label> patchIds;
|
dynamicLabelList patchIds;
|
||||||
|
|
||||||
if (args.options().found("patchNames"))
|
if (args.options().found("patchNames"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
|
||||||
fZone.checkParallelSync(true);
|
fZone.checkParallelSync(true);
|
||||||
|
|
||||||
// Patches to put baffles into
|
// Patches to put baffles into
|
||||||
DynamicList<label> newPatches(1);
|
dynamicLabelList newPatches(1);
|
||||||
|
|
||||||
word patchName(args.additionalArgs()[1]);
|
word patchName(args.additionalArgs()[1]);
|
||||||
newPatches.append(findPatchID(mesh, patchName));
|
newPatches.append(findPatchID(mesh, patchName));
|
||||||
|
|
|
@ -481,7 +481,7 @@ void Foam::mergePolyMesh::merge()
|
||||||
{
|
{
|
||||||
Info << "Updating point zones" << endl;
|
Info << "Updating point zones" << endl;
|
||||||
|
|
||||||
List<DynamicList<label> > pzPoints(pointZoneNames_.size());
|
List<dynamicLabelList > pzPoints(pointZoneNames_.size());
|
||||||
forAll(pointZones_, pointI)
|
forAll(pointZones_, pointI)
|
||||||
{
|
{
|
||||||
label zoneID = pointZones_[pointI];
|
label zoneID = pointZones_[pointI];
|
||||||
|
@ -506,7 +506,7 @@ void Foam::mergePolyMesh::merge()
|
||||||
{
|
{
|
||||||
Info << "Updating face zones" << endl;
|
Info << "Updating face zones" << endl;
|
||||||
|
|
||||||
List<DynamicList<label> > fzFaces(faceZoneNames_.size());
|
List<dynamicLabelList > fzFaces(faceZoneNames_.size());
|
||||||
List<DynamicList<bool> > fzFlips(faceZoneNames_.size());
|
List<DynamicList<bool> > fzFlips(faceZoneNames_.size());
|
||||||
|
|
||||||
forAll(faceZones_, faceI)
|
forAll(faceZones_, faceI)
|
||||||
|
@ -540,7 +540,7 @@ void Foam::mergePolyMesh::merge()
|
||||||
{
|
{
|
||||||
Info << "Updating cell zones" << endl;
|
Info << "Updating cell zones" << endl;
|
||||||
|
|
||||||
List<DynamicList<label> > czCells(cellZoneNames_.size());
|
List<dynamicLabelList > czCells(cellZoneNames_.size());
|
||||||
forAll(cellZones_, cellI)
|
forAll(cellZones_, cellI)
|
||||||
{
|
{
|
||||||
label zoneID = cellZones_[cellI];
|
label zoneID = cellZones_[cellI];
|
||||||
|
|
|
@ -74,16 +74,16 @@ class mergePolyMesh
|
||||||
DynamicList<word> cellZoneNames_;
|
DynamicList<word> cellZoneNames_;
|
||||||
|
|
||||||
//- Point zones
|
//- Point zones
|
||||||
DynamicList<label> pointZones_;
|
dynamicLabelList pointZones_;
|
||||||
|
|
||||||
//- Face zones
|
//- Face zones
|
||||||
DynamicList<label> faceZones_;
|
dynamicLabelList faceZones_;
|
||||||
|
|
||||||
//- Face zone Flips
|
//- Face zone Flips
|
||||||
DynamicList<bool> faceZoneFlips_;
|
DynamicList<bool> faceZoneFlips_;
|
||||||
|
|
||||||
//- Cell zones
|
//- Cell zones
|
||||||
DynamicList<label> cellZones_;
|
dynamicLabelList cellZones_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
|
@ -56,7 +56,7 @@ string getLine(std::ifstream& is)
|
||||||
// Read space-separated vertices (with optional '/' arguments)
|
// Read space-separated vertices (with optional '/' arguments)
|
||||||
labelList parseVertices(const string& line)
|
labelList parseVertices(const string& line)
|
||||||
{
|
{
|
||||||
DynamicList<label> verts;
|
dynamicLabelList verts;
|
||||||
|
|
||||||
// Assume 'l' is followed by space.
|
// Assume 'l' is followed by space.
|
||||||
string::size_type endNum = 1;
|
string::size_type endNum = 1;
|
||||||
|
|
|
@ -30,6 +30,15 @@ License
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// MacOSX
|
||||||
|
#ifdef __DARWIN_BYTE_ORDER
|
||||||
|
#if __DARWIN_BYTE_ORDER==__DARWIN_BIG_ENDIAN
|
||||||
|
#undef LITTLE_ENDIAN
|
||||||
|
#else
|
||||||
|
#undef BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(LITTLE_ENDIAN) \
|
#if defined(LITTLE_ENDIAN) \
|
||||||
|| defined(_LITTLE_ENDIAN) \
|
|| defined(_LITTLE_ENDIAN) \
|
||||||
|| defined(__LITTLE_ENDIAN)
|
|| defined(__LITTLE_ENDIAN)
|
||||||
|
@ -43,9 +52,9 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::writeFuns::swapWord(label& word32)
|
void Foam::writeFuns::swapWord(int32_t& word32)
|
||||||
{
|
{
|
||||||
char* mem = reinterpret_cast<char*>(&word32);
|
char* mem = reinterpret_cast<char*>(&word32);
|
||||||
|
|
||||||
char a = mem[0];
|
char a = mem[0];
|
||||||
mem[0] = mem[3];
|
mem[0] = mem[3];
|
||||||
|
@ -57,7 +66,7 @@ void Foam::writeFuns::swapWord(label& word32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::writeFuns::swapWords(const label nWords, label* words32)
|
void Foam::writeFuns::swapWords(const label nWords, int32_t* words32)
|
||||||
{
|
{
|
||||||
for (label i = 0; i < nWords; i++)
|
for (label i = 0; i < nWords; i++)
|
||||||
{
|
{
|
||||||
|
@ -75,9 +84,9 @@ void Foam::writeFuns::write
|
||||||
{
|
{
|
||||||
if (binary)
|
if (binary)
|
||||||
{
|
{
|
||||||
# ifdef LITTLEENDIAN
|
#ifdef LITTLEENDIAN
|
||||||
swapWords(fField.size(), reinterpret_cast<label*>(fField.begin()));
|
swapWords(fField.size(), reinterpret_cast<int32_t*>(fField.begin()));
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
|
@ -125,9 +134,13 @@ void Foam::writeFuns::write
|
||||||
{
|
{
|
||||||
if (binary)
|
if (binary)
|
||||||
{
|
{
|
||||||
# ifdef LITTLEENDIAN
|
#ifdef LITTLEENDIAN
|
||||||
swapWords(elems.size(), reinterpret_cast<label*>(elems.begin()));
|
swapWords
|
||||||
# endif
|
(
|
||||||
|
(sizeof(label)/4)*elems.size(),
|
||||||
|
reinterpret_cast<int32_t*>(elems.begin())
|
||||||
|
);
|
||||||
|
#endif
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<char*>(elems.begin()),
|
reinterpret_cast<char*>(elems.begin()),
|
||||||
|
@ -156,7 +169,7 @@ void Foam::writeFuns::write
|
||||||
(
|
(
|
||||||
std::ostream& os,
|
std::ostream& os,
|
||||||
const bool binary,
|
const bool binary,
|
||||||
DynamicList<label>& elems
|
dynamicLabelList& elems
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList& fld = elems.shrink();
|
labelList& fld = elems.shrink();
|
||||||
|
@ -175,7 +188,7 @@ void Foam::writeFuns::insert(const point& pt, DynamicList<floatScalar>& dest)
|
||||||
|
|
||||||
|
|
||||||
// Store labelList in dest.
|
// Store labelList in dest.
|
||||||
void Foam::writeFuns::insert(const labelList& source, DynamicList<label>& dest)
|
void Foam::writeFuns::insert(const labelList& source, dynamicLabelList& dest)
|
||||||
{
|
{
|
||||||
forAll(source, i)
|
forAll(source, i)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +200,7 @@ void Foam::writeFuns::insert(const labelList& source, DynamicList<label>& dest)
|
||||||
// Store scalarField in dest
|
// Store scalarField in dest
|
||||||
void Foam::writeFuns::insert
|
void Foam::writeFuns::insert
|
||||||
(
|
(
|
||||||
const List<scalar>& source,
|
const scalarList& source,
|
||||||
DynamicList<floatScalar>& dest
|
DynamicList<floatScalar>& dest
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +215,7 @@ void Foam::writeFuns::insert
|
||||||
void Foam::writeFuns::insert
|
void Foam::writeFuns::insert
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
const List<scalar>& source,
|
const scalarList& source,
|
||||||
DynamicList<floatScalar>& dest
|
DynamicList<floatScalar>& dest
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,9 +36,10 @@ SourceFiles
|
||||||
#define writeFunctions_H
|
#define writeFunctions_H
|
||||||
|
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
|
#include "scalarList.H"
|
||||||
#include "floatScalar.H"
|
#include "floatScalar.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "DynamicList.H"
|
#include "dynamicLabelList.H"
|
||||||
#include "point.H"
|
#include "point.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
@ -55,15 +56,20 @@ namespace Foam
|
||||||
|
|
||||||
class writeFuns
|
class writeFuns
|
||||||
{
|
{
|
||||||
//- Swap halves of word.
|
// Private member functions
|
||||||
static void swapWord(label& word32);
|
|
||||||
static void swapWords(const label nWords, label* words32);
|
//- Swap halves of word
|
||||||
|
static void swapWord(int32_t& word32);
|
||||||
|
|
||||||
|
//- Swap halves of word
|
||||||
|
static void swapWords(const label nWords, int32_t* words32);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Write ascii or binary. If binary optionally in-place swaps argument
|
//- Write ascii or binary. If binary optionally in-place swaps argument
|
||||||
static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
|
static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
|
||||||
static void write(std::ostream&, const bool, DynamicList<label>&);
|
static void write(std::ostream&, const bool, dynamicLabelList&);
|
||||||
|
|
||||||
//- Write ascii or binary. If binary optionally in-place swaps argument
|
//- Write ascii or binary. If binary optionally in-place swaps argument
|
||||||
static void write(std::ostream&, const bool, List<floatScalar>&);
|
static void write(std::ostream&, const bool, List<floatScalar>&);
|
||||||
|
@ -73,15 +79,15 @@ public:
|
||||||
static void insert(const point&, DynamicList<floatScalar>& dest);
|
static void insert(const point&, DynamicList<floatScalar>& dest);
|
||||||
|
|
||||||
//- Append elements of labelList to DynamicList
|
//- Append elements of labelList to DynamicList
|
||||||
static void insert(const labelList&, DynamicList<label>&);
|
static void insert(const labelList&, dynamicLabelList&);
|
||||||
//- Append elements of scalarList to DynamicList
|
//- Append elements of scalarList to DynamicList
|
||||||
static void insert(const List<scalar>&, DynamicList<floatScalar>&);
|
static void insert(const scalarList&, DynamicList<floatScalar>&);
|
||||||
|
|
||||||
//- Append elements of scalarList to DynamicList using map
|
//- Append elements of scalarList to DynamicList using map
|
||||||
static void insert
|
static void insert
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
const List<scalar>& source,
|
const scalarList& source,
|
||||||
DynamicList<floatScalar>&
|
DynamicList<floatScalar>&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ void writePatch
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
|
|
||||||
forAll(fp.localFaces(), faceI)
|
forAll(fp.localFaces(), faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
|
||||||
faceSet set(*iter());
|
faceSet set(*iter());
|
||||||
SortableList<label> faceLabels(set.toc());
|
SortableList<label> faceLabels(set.toc());
|
||||||
|
|
||||||
DynamicList<label> addressing(set.size());
|
dynamicLabelList addressing(set.size());
|
||||||
DynamicList<bool> flipMap(set.size());
|
DynamicList<bool> flipMap(set.size());
|
||||||
|
|
||||||
if (!noFlipMap)
|
if (!noFlipMap)
|
||||||
|
|
|
@ -486,7 +486,7 @@ void subsetSurfaceFields
|
||||||
// Select all cells not in the region
|
// Select all cells not in the region
|
||||||
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
|
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
|
||||||
{
|
{
|
||||||
DynamicList<label> nonRegionCells(cellRegion.size());
|
dynamicLabelList nonRegionCells(cellRegion.size());
|
||||||
forAll (cellRegion, cellI)
|
forAll (cellRegion, cellI)
|
||||||
{
|
{
|
||||||
if (cellRegion[cellI] != regionI)
|
if (cellRegion[cellI] != regionI)
|
||||||
|
|
|
@ -180,10 +180,10 @@ if (fieldTimesUsed.size())
|
||||||
|
|
||||||
// TODO: allow similar/different time-steps for each cloud
|
// TODO: allow similar/different time-steps for each cloud
|
||||||
cloudNo = 0;
|
cloudNo = 0;
|
||||||
forAllConstIter(HashTable<DynamicList<label> >, cloudTimesUsed, cloudIter)
|
forAllConstIter(HashTable<dynamicLabelList >, cloudTimesUsed, cloudIter)
|
||||||
{
|
{
|
||||||
// const word& cloudName = cloudIter.key();
|
// const word& cloudName = cloudIter.key();
|
||||||
const DynamicList<label>& timesUsed = cloudIter();
|
const dynamicLabelList& timesUsed = cloudIter();
|
||||||
|
|
||||||
if (timesUsed.size() && cloudNo == 0)
|
if (timesUsed.size() && cloudNo == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -175,15 +175,15 @@ int main(int argc, char *argv[])
|
||||||
Map<scalar> timeIndices;
|
Map<scalar> timeIndices;
|
||||||
|
|
||||||
// Track the time indices used by the volume fields
|
// Track the time indices used by the volume fields
|
||||||
DynamicList<label> fieldTimesUsed;
|
dynamicLabelList fieldTimesUsed;
|
||||||
|
|
||||||
// Track the time indices used by each cloud
|
// Track the time indices used by each cloud
|
||||||
HashTable<DynamicList<label> > cloudTimesUsed;
|
HashTable<dynamicLabelList > cloudTimesUsed;
|
||||||
|
|
||||||
// Create a new DynamicList for each cloud
|
// Create a new DynamicList for each cloud
|
||||||
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
||||||
{
|
{
|
||||||
cloudTimesUsed.insert(cloudIter.key(), DynamicList<label>());
|
cloudTimesUsed.insert(cloudIter.key(), dynamicLabelList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ Foam::fieldviewTopology::fieldviewTopology
|
||||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||||
|
|
||||||
// Pre calculate headers for cells not on walls
|
// Pre calculate headers for cells not on walls
|
||||||
labelList notWallFlags(6, NOT_A_WALL);
|
List<int> notWallFlags(6, NOT_A_WALL);
|
||||||
label tetNotWall = fv_encode_elem_header
|
label tetNotWall = fv_encode_elem_header
|
||||||
(
|
(
|
||||||
FV_TET_ELEM_ID, notWallFlags.begin()
|
FV_TET_ELEM_ID, notWallFlags.begin()
|
||||||
|
@ -181,7 +181,7 @@ Foam::fieldviewTopology::fieldviewTopology
|
||||||
|
|
||||||
const faceList& allFaces = mesh.faces();
|
const faceList& allFaces = mesh.faces();
|
||||||
|
|
||||||
labelList wallFlags(6);
|
List<int> wallFlags(6);
|
||||||
forAll(cellShapes, celli)
|
forAll(cellShapes, celli)
|
||||||
{
|
{
|
||||||
const cellShape& cellShape = cellShapes[celli];
|
const cellShape& cellShape = cellShapes[celli];
|
||||||
|
|
|
@ -125,7 +125,7 @@ labelList getSelectedPatches
|
||||||
const List<wordRe>& excludePatches //HashSet<word>& excludePatches
|
const List<wordRe>& excludePatches //HashSet<word>& excludePatches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DynamicList<label> patchIDs(patches.size());
|
dynamicLabelList patchIDs(patches.size());
|
||||||
|
|
||||||
Info<< "Combining patches:" << endl;
|
Info<< "Combining patches:" << endl;
|
||||||
|
|
||||||
|
|
|
@ -395,7 +395,8 @@ void Foam::tecplotWriter::writeConnectivity
|
||||||
INTEGER4 NumFaceNodes = 2*pp.nEdges();
|
INTEGER4 NumFaceNodes = 2*pp.nEdges();
|
||||||
|
|
||||||
// All faces (=edges) have 2 nodes
|
// All faces (=edges) have 2 nodes
|
||||||
List<INTEGER4> FaceNodeCounts(NumFaces, 2);
|
List<INTEGER4> FaceNodeCounts(NumFaces);
|
||||||
|
FaceNodeCounts = 2;
|
||||||
|
|
||||||
List<INTEGER4> FaceNodes(NumFaceNodes);
|
List<INTEGER4> FaceNodes(NumFaceNodes);
|
||||||
label nodeI = 0;
|
label nodeI = 0;
|
||||||
|
|
|
@ -64,8 +64,8 @@ Foam::faMeshWriter::faMeshWriter
|
||||||
os_ << "CELLS " << aMesh.nFaces() << ' ' << nFaceVerts
|
os_ << "CELLS " << aMesh.nFaces() << ' ' << nFaceVerts
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
DynamicList<label> faceTypes(nFaceVerts);
|
dynamicLabelList faceTypes(nFaceVerts);
|
||||||
|
|
||||||
forAll(pp, faceI)
|
forAll(pp, faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -176,7 +176,7 @@ labelList getSelectedPatches
|
||||||
const HashSet<word>& excludePatches
|
const HashSet<word>& excludePatches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DynamicList<label> patchIDs(patches.size());
|
dynamicLabelList patchIDs(patches.size());
|
||||||
|
|
||||||
Info<< "Combining patches:" << endl;
|
Info<< "Combining patches:" << endl;
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ Foam::internalWriter::internalWriter
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
|
|
||||||
forAll(vtkVertLabels, cellI)
|
forAll(vtkVertLabels, cellI)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,7 @@ Foam::internalWriter::internalWriter
|
||||||
os_ << "CELL_TYPES " << vtkCellTypes.size() << std::endl;
|
os_ << "CELL_TYPES " << vtkCellTypes.size() << std::endl;
|
||||||
|
|
||||||
// Make copy since writing might swap stuff.
|
// Make copy since writing might swap stuff.
|
||||||
DynamicList<label> cellTypes(vtkCellTypes.size());
|
dynamicLabelList cellTypes(vtkCellTypes.size());
|
||||||
|
|
||||||
writeFuns::insert(vtkCellTypes, cellTypes);
|
writeFuns::insert(vtkCellTypes, cellTypes);
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,8 @@ Foam::patchWriter::patchWriter
|
||||||
os_ << "CELLS " << nFaces_ << ' ' << nFaceVerts
|
os_ << "CELLS " << nFaces_ << ' ' << nFaceVerts
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
DynamicList<label> faceTypes(nFaceVerts);
|
dynamicLabelList faceTypes(nFaceVerts);
|
||||||
|
|
||||||
label offset = 0;
|
label offset = 0;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ void writeFaceSet
|
||||||
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
|
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
|
|
||||||
forAll(lf, faceI)
|
forAll(lf, faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,7 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::writeFuns::swapWord(label& word32)
|
void Foam::writeFuns::swapWord(int32_t& word32)
|
||||||
{
|
{
|
||||||
char* mem = reinterpret_cast<char*>(&word32);
|
char* mem = reinterpret_cast<char*>(&word32);
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ void Foam::writeFuns::swapWord(label& word32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::writeFuns::swapWords(const label nWords, label* words32)
|
void Foam::writeFuns::swapWords(const label nWords, int32_t* words32)
|
||||||
{
|
{
|
||||||
for (label i = 0; i < nWords; i++)
|
for (label i = 0; i < nWords; i++)
|
||||||
{
|
{
|
||||||
|
@ -85,9 +85,10 @@ void Foam::writeFuns::write
|
||||||
{
|
{
|
||||||
if (binary)
|
if (binary)
|
||||||
{
|
{
|
||||||
# ifdef LITTLEENDIAN
|
#ifdef LITTLEENDIAN
|
||||||
swapWords(fField.size(), reinterpret_cast<label*>(fField.begin()));
|
swapWords(fField.size(), reinterpret_cast<int32_t*>(fField.begin()));
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<char*>(fField.begin()),
|
reinterpret_cast<char*>(fField.begin()),
|
||||||
|
@ -134,9 +135,13 @@ void Foam::writeFuns::write
|
||||||
{
|
{
|
||||||
if (binary)
|
if (binary)
|
||||||
{
|
{
|
||||||
# ifdef LITTLEENDIAN
|
#ifdef LITTLEENDIAN
|
||||||
swapWords(elems.size(), reinterpret_cast<label*>(elems.begin()));
|
swapWords
|
||||||
# endif
|
(
|
||||||
|
(sizeof(label)/4)*elems.size(),
|
||||||
|
reinterpret_cast<int32_t*>(elems.begin())
|
||||||
|
);
|
||||||
|
#endif
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<char*>(elems.begin()),
|
reinterpret_cast<char*>(elems.begin()),
|
||||||
|
@ -165,7 +170,7 @@ void Foam::writeFuns::write
|
||||||
(
|
(
|
||||||
std::ostream& os,
|
std::ostream& os,
|
||||||
const bool binary,
|
const bool binary,
|
||||||
DynamicList<label>& elems
|
dynamicLabelList& elems
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList& fld = elems.shrink();
|
labelList& fld = elems.shrink();
|
||||||
|
@ -269,7 +274,7 @@ void Foam::writeFuns::insert(const tensor& pt, DynamicList<floatScalar>& dest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::writeFuns::insert(const labelList& source, DynamicList<label>& dest)
|
void Foam::writeFuns::insert(const labelList& source, dynamicLabelList& dest)
|
||||||
{
|
{
|
||||||
forAll(source, i)
|
forAll(source, i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,10 +55,11 @@ class writeFuns
|
||||||
{
|
{
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|
||||||
// Swap halves of word.
|
//- Swap halves of word
|
||||||
|
static void swapWord(int32_t& word32);
|
||||||
|
|
||||||
static void swapWord(label& word32);
|
//- Swap halves of word
|
||||||
static void swapWords(const label nWords, label* words32);
|
static void swapWords(const label nWords, int32_t* words32);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -68,7 +69,7 @@ public:
|
||||||
static void write(std::ostream&, const bool, List<floatScalar>&);
|
static void write(std::ostream&, const bool, List<floatScalar>&);
|
||||||
static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
|
static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
|
||||||
static void write(std::ostream&, const bool, labelList&);
|
static void write(std::ostream&, const bool, labelList&);
|
||||||
static void write(std::ostream&, const bool, DynamicList<label>&);
|
static void write(std::ostream&, const bool, dynamicLabelList&);
|
||||||
|
|
||||||
|
|
||||||
// Write header
|
// Write header
|
||||||
|
@ -105,7 +106,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
//- Append elements to DynamicList
|
//- Append elements to DynamicList
|
||||||
static void insert(const labelList&, DynamicList<label>&);
|
static void insert(const labelList&, dynamicLabelList&);
|
||||||
template<class Type>
|
template<class Type>
|
||||||
static void insert(const List<Type>&, DynamicList<floatScalar>&);
|
static void insert(const List<Type>&, DynamicList<floatScalar>&);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ void writePatchGeom
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
dynamicLabelList vertLabels(nFaceVerts);
|
||||||
|
|
||||||
forAll(faces, faceI)
|
forAll(faces, faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,9 +43,9 @@ static fileName caseDir;
|
||||||
|
|
||||||
static instantList timeDirs;
|
static instantList timeDirs;
|
||||||
|
|
||||||
static List<word> fieldNames;
|
static wordList fieldNames;
|
||||||
static List<word> lagrangianScalarNames;
|
static wordList lagrangianScalarNames;
|
||||||
static List<word> lagrangianVectorNames;
|
static wordList lagrangianVectorNames;
|
||||||
static label var2field[maxNames];
|
static label var2field[maxNames];
|
||||||
|
|
||||||
static Time *runTimePtr = 0;
|
static Time *runTimePtr = 0;
|
||||||
|
|
|
@ -50,7 +50,7 @@ void Foam::readerDatabase::getPolyHedra()
|
||||||
const cellModel& tetWedge = *(cellModeller::lookup("tetWedge"));
|
const cellModel& tetWedge = *(cellModeller::lookup("tetWedge"));
|
||||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||||
|
|
||||||
DynamicList<label> polys(mesh().nCells()/100 + 1);
|
dynamicLabelList polys(mesh().nCells()/100 + 1);
|
||||||
|
|
||||||
const cellShapeList& cellShapes = mesh().cellShapes();
|
const cellShapeList& cellShapes = mesh().cellShapes();
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@ static fileName caseDir;
|
||||||
|
|
||||||
static instantList TimeList;
|
static instantList TimeList;
|
||||||
|
|
||||||
static List<word> fieldNames;
|
static wordList fieldNames;
|
||||||
static List<word> lagrangianScalarNames;
|
static wordList lagrangianScalarNames;
|
||||||
static List<word> lagrangianVectorNames;
|
static wordList lagrangianVectorNames;
|
||||||
static label var2field[maxNames];
|
static label var2field[maxNames];
|
||||||
|
|
||||||
static Time *runTimePtr = 0;
|
static Time *runTimePtr = 0;
|
||||||
|
@ -57,7 +57,7 @@ static Cloud<passiveParticle> *sprayPtr = 0;
|
||||||
static fvMesh* secondMeshPtr = 0;
|
static fvMesh* secondMeshPtr = 0;
|
||||||
static int nSecondMeshPatches = 0;
|
static int nSecondMeshPatches = 0;
|
||||||
static char secondMeshName[] = "cells_2";
|
static char secondMeshName[] = "cells_2";
|
||||||
static List<word> secondMeshFieldNames;
|
static wordList secondMeshFieldNames;
|
||||||
static label secondMeshVar2field[maxNames];
|
static label secondMeshVar2field[maxNames];
|
||||||
static bool secondMeshIsScalar[maxNames];
|
static bool secondMeshIsScalar[maxNames];
|
||||||
static bool secondMeshIsVector[maxNames];
|
static bool secondMeshIsVector[maxNames];
|
||||||
|
@ -71,7 +71,7 @@ static word faScalarName = "areaScalarField";
|
||||||
static word faVectorName = "areaVectorField";
|
static word faVectorName = "areaVectorField";
|
||||||
static word faTensorName = "areaTensorField";
|
static word faTensorName = "areaTensorField";
|
||||||
static char faMeshName[] = "faCells";
|
static char faMeshName[] = "faCells";
|
||||||
static List<word> faMeshFieldNames;
|
static wordList faMeshFieldNames;
|
||||||
static label faMeshVar2field[maxNames];
|
static label faMeshVar2field[maxNames];
|
||||||
static bool faMeshIsScalar[maxNames];
|
static bool faMeshIsScalar[maxNames];
|
||||||
static bool faMeshIsVector[maxNames];
|
static bool faMeshIsVector[maxNames];
|
||||||
|
|
|
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
|
|
||||||
// calc starting ids for particles on each processor
|
// calc starting ids for particles on each processor
|
||||||
List<label> startIds(numIds.size(), 0);
|
labelList startIds(numIds.size(), 0);
|
||||||
for (label i = 0; i < numIds.size()-1; i++)
|
for (label i = 0; i < numIds.size()-1; i++)
|
||||||
{
|
{
|
||||||
startIds[i+1] += startIds[i] + numIds[i];
|
startIds[i+1] += startIds[i] + numIds[i];
|
||||||
|
|
|
@ -59,7 +59,7 @@ void Foam::channelIndex::walkOppositeFaces
|
||||||
const faceList& faces = mesh.faces();
|
const faceList& faces = mesh.faces();
|
||||||
label nBnd = mesh.nFaces() - mesh.nInternalFaces();
|
label nBnd = mesh.nFaces() - mesh.nInternalFaces();
|
||||||
|
|
||||||
DynamicList<label> frontFaces(startFaces);
|
dynamicLabelList frontFaces(startFaces);
|
||||||
forAll(frontFaces, i)
|
forAll(frontFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = frontFaces[i];
|
label faceI = frontFaces[i];
|
||||||
|
@ -93,7 +93,7 @@ void Foam::channelIndex::walkOppositeFaces
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transfer across cells
|
// Transfer across cells
|
||||||
DynamicList<label> newFrontFaces(frontFaces.size());
|
dynamicLabelList newFrontFaces(frontFaces.size());
|
||||||
|
|
||||||
forAll(frontFaces, i)
|
forAll(frontFaces, i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -427,7 +427,7 @@ int main(int argc, char *argv[])
|
||||||
);
|
);
|
||||||
|
|
||||||
List<boundBox> bbsTarget(nProcsTarget);
|
List<boundBox> bbsTarget(nProcsTarget);
|
||||||
List<bool> bbsTargetSet(nProcsTarget, false);
|
boolList bbsTargetSet(nProcsTarget, false);
|
||||||
|
|
||||||
for (int procISource=0; procISource<nProcsSource; procISource++)
|
for (int procISource=0; procISource<nProcsSource; procISource++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
||||||
label sourceParticleI = 0;
|
label sourceParticleI = 0;
|
||||||
|
|
||||||
// Indices of source particles that get added to targetParcels
|
// Indices of source particles that get added to targetParcels
|
||||||
DynamicList<label> addParticles(sourceParcels.size());
|
dynamicLabelList addParticles(sourceParcels.size());
|
||||||
|
|
||||||
// Unmapped particles
|
// Unmapped particles
|
||||||
labelHashSet unmappedSource(sourceParcels.size());
|
labelHashSet unmappedSource(sourceParcels.size());
|
||||||
|
|
|
@ -11,8 +11,8 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||||
|
|
||||||
DynamicField<point> start(coarseMesh.nFaces());
|
DynamicField<point> start(coarseMesh.nFaces());
|
||||||
DynamicField<point> end(start.size());
|
DynamicField<point> end(start.size());
|
||||||
DynamicList<label> startIndex(start.size());
|
dynamicLabelList startIndex(start.size());
|
||||||
DynamicList<label> endIndex(start.size());
|
dynamicLabelList endIndex(start.size());
|
||||||
|
|
||||||
const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
|
const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
|
||||||
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
|
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
|
||||||
|
|
|
@ -400,9 +400,9 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Determine rays between coarse face centres
|
// Determine rays between coarse face centres
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
DynamicList<label> rayStartFace(nCoarseFaces + 0.01*nCoarseFaces);
|
dynamicLabelList rayStartFace(nCoarseFaces + 0.01*nCoarseFaces);
|
||||||
|
|
||||||
DynamicList<label> rayEndFace(rayStartFace.size());
|
dynamicLabelList rayEndFace(rayStartFace.size());
|
||||||
|
|
||||||
globalIndex globalNumbering(nCoarseFaces);
|
globalIndex globalNumbering(nCoarseFaces);
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ int main(int argc, char *argv[])
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
List<label>(1, map.constructSize())
|
labelList(1, map.constructSize())
|
||||||
);
|
);
|
||||||
consMapDim.write();
|
consMapDim.write();
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ int main(int argc, char *argv[])
|
||||||
List<List<point> > compactFineSf(map.constructSize());
|
List<List<point> > compactFineSf(map.constructSize());
|
||||||
List<List<point> > compactFineCf(map.constructSize());
|
List<List<point> > compactFineCf(map.constructSize());
|
||||||
|
|
||||||
DynamicList<label> compactPatchId(map.constructSize());
|
dynamicLabelList compactPatchId(map.constructSize());
|
||||||
|
|
||||||
// Insert my coarse local values
|
// Insert my coarse local values
|
||||||
SubList<point>(compactCoarseSf, nCoarseFaces).assign(localCoarseSf);
|
SubList<point>(compactCoarseSf, nCoarseFaces).assign(localCoarseSf);
|
||||||
|
|
|
@ -236,7 +236,7 @@ int main(int argc, char *argv[])
|
||||||
// ~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
{
|
{
|
||||||
DynamicList<label> illegalFaces(surf.size()/100 + 1);
|
dynamicLabelList illegalFaces(surf.size()/100 + 1);
|
||||||
|
|
||||||
forAll(surf, faceI)
|
forAll(surf, faceI)
|
||||||
{
|
{
|
||||||
|
@ -350,7 +350,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Dump for subsetting
|
// Dump for subsetting
|
||||||
{
|
{
|
||||||
DynamicList<label> problemFaces(surf.size()/100+1);
|
dynamicLabelList problemFaces(surf.size()/100+1);
|
||||||
|
|
||||||
forAll(triQ, faceI)
|
forAll(triQ, faceI)
|
||||||
{
|
{
|
||||||
|
@ -481,7 +481,7 @@ int main(int argc, char *argv[])
|
||||||
// Check manifold
|
// Check manifold
|
||||||
// ~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
DynamicList<label> problemFaces(surf.size()/100 + 1);
|
dynamicLabelList problemFaces(surf.size()/100 + 1);
|
||||||
|
|
||||||
const labelListList& eFaces = surf.edgeFaces();
|
const labelListList& eFaces = surf.edgeFaces();
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,11 @@ void readNASEdges
|
||||||
// coordinates of point
|
// coordinates of point
|
||||||
DynamicList<point> points;
|
DynamicList<point> points;
|
||||||
// Nastran index of point
|
// Nastran index of point
|
||||||
DynamicList<label> pointIndices;
|
dynamicLabelList pointIndices;
|
||||||
|
|
||||||
// beams
|
// beams
|
||||||
DynamicList<edge> edges;
|
DynamicList<edge> edges;
|
||||||
DynamicList<label> edgeIndices;
|
dynamicLabelList edgeIndices;
|
||||||
|
|
||||||
|
|
||||||
while (is.good())
|
while (is.good())
|
||||||
|
|
|
@ -193,7 +193,7 @@ void Foam::boundaryMesh::markEdges
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label distance,
|
const label distance,
|
||||||
labelList& minDistance,
|
labelList& minDistance,
|
||||||
DynamicList<label>& visited
|
dynamicLabelList& visited
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (distance < maxDistance)
|
if (distance < maxDistance)
|
||||||
|
@ -865,8 +865,8 @@ Foam::labelList Foam::boundaryMesh::getNearest
|
||||||
// Divide faces into two bins acc. to normal
|
// Divide faces into two bins acc. to normal
|
||||||
// - left of splitNormal
|
// - left of splitNormal
|
||||||
// - right ,,
|
// - right ,,
|
||||||
DynamicList<label> leftFaces(mesh().size()/2);
|
dynamicLabelList leftFaces(mesh().size()/2);
|
||||||
DynamicList<label> rightFaces(mesh().size()/2);
|
dynamicLabelList rightFaces(mesh().size()/2);
|
||||||
|
|
||||||
forAll(mesh(), bFaceI)
|
forAll(mesh(), bFaceI)
|
||||||
{
|
{
|
||||||
|
@ -1253,7 +1253,7 @@ void Foam::boundaryMesh::patchify
|
||||||
|
|
||||||
if (newPatchPtrList.size())
|
if (newPatchPtrList.size())
|
||||||
{
|
{
|
||||||
List<DynamicList<label> > patchFaces(nNewPatches);
|
List<dynamicLabelList > patchFaces(nNewPatches);
|
||||||
|
|
||||||
// Give reasonable estimate for size of patches
|
// Give reasonable estimate for size of patches
|
||||||
label nAvgFaces =
|
label nAvgFaces =
|
||||||
|
@ -1516,7 +1516,7 @@ void Foam::boundaryMesh::setExtraEdges(const label edgeI)
|
||||||
labelList minDistance(mesh().nEdges(), -1);
|
labelList minDistance(mesh().nEdges(), -1);
|
||||||
|
|
||||||
// All edge labels encountered
|
// All edge labels encountered
|
||||||
DynamicList<label> visitedEdges;
|
dynamicLabelList visitedEdges;
|
||||||
|
|
||||||
// Floodfill from edgeI starting from distance 0. Stop at distance.
|
// Floodfill from edgeI starting from distance 0. Stop at distance.
|
||||||
markEdges(8, edgeI, 0, minDistance, visitedEdges);
|
markEdges(8, edgeI, 0, minDistance, visitedEdges);
|
||||||
|
|
|
@ -132,7 +132,7 @@ class boundaryMesh
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label distance,
|
const label distance,
|
||||||
labelList& minDistance,
|
labelList& minDistance,
|
||||||
DynamicList<label>& visited
|
dynamicLabelList& visited
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Get index of polypatch by name
|
//- Get index of polypatch by name
|
||||||
|
|
|
@ -173,11 +173,11 @@ int main(int argc, char *argv[])
|
||||||
// Create Look Up Table
|
// Create Look Up Table
|
||||||
interpolationLookUpTable<scalar> LookUpTable(control);
|
interpolationLookUpTable<scalar> LookUpTable(control);
|
||||||
|
|
||||||
const List<label>& dim = LookUpTable.dim();
|
const labelList& dim = LookUpTable.dim();
|
||||||
|
|
||||||
const List<scalar>& min = LookUpTable.min();
|
const scalarList& min = LookUpTable.min();
|
||||||
|
|
||||||
const List<scalar>& delta = LookUpTable.delta();
|
const scalarList& delta = LookUpTable.delta();
|
||||||
|
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
|
||||||
# wmake configuration
|
# wmake configuration
|
||||||
setenv WM_DIR $WM_PROJECT_DIR/wmake
|
setenv WM_DIR $WM_PROJECT_DIR/wmake
|
||||||
setenv WM_LINK_LANGUAGE c++
|
setenv WM_LINK_LANGUAGE c++
|
||||||
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
|
setenv WM_LABEL_OPTION "Int$WM_LABEL_SIZE"
|
||||||
|
setenv WM_OPTIONS "$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION$WM_COMPILE_OPTION"
|
||||||
set path=($WM_DIR $path)
|
set path=($WM_DIR $path)
|
||||||
|
|
||||||
# base configuration
|
# base configuration
|
||||||
|
|
|
@ -79,7 +79,8 @@ export FOAM_JOB_DIR=$HOME/$WM_PROJECT/jobControl
|
||||||
# wmake configuration
|
# wmake configuration
|
||||||
export WM_DIR=$WM_PROJECT_DIR/wmake
|
export WM_DIR=$WM_PROJECT_DIR/wmake
|
||||||
export WM_LINK_LANGUAGE=c++
|
export WM_LINK_LANGUAGE=c++
|
||||||
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
|
export WM_LABEL_OPTION="Int$WM_LABEL_SIZE"
|
||||||
|
export WM_OPTIONS="$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION$WM_COMPILE_OPTION"
|
||||||
export PATH=$WM_DIR:$PATH
|
export PATH=$WM_DIR:$PATH
|
||||||
|
|
||||||
# base configuration
|
# base configuration
|
||||||
|
|
|
@ -40,7 +40,7 @@ Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const
|
bool Foam::ensightPart::isFieldDefined(const scalarList& field) const
|
||||||
{
|
{
|
||||||
forAll(elemLists_, elemI)
|
forAll(elemLists_, elemI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ class ensightPart
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
static List<word> elemTypes_;
|
static wordList elemTypes_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -126,7 +126,7 @@ protected:
|
||||||
void reconstruct(Istream&);
|
void reconstruct(Istream&);
|
||||||
|
|
||||||
//- check for fully defined fields
|
//- check for fully defined fields
|
||||||
bool isFieldDefined(const List<scalar>&) const;
|
bool isFieldDefined(const scalarList&) const;
|
||||||
|
|
||||||
//- write the part header
|
//- write the part header
|
||||||
void writeHeader(ensightFile&, bool withDescription=false) const;
|
void writeHeader(ensightFile&, bool withDescription=false) const;
|
||||||
|
@ -135,7 +135,7 @@ protected:
|
||||||
void writeFieldList
|
void writeFieldList
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field,
|
const scalarList& field,
|
||||||
const labelList& idList
|
const labelList& idList
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ public:
|
||||||
|
|
||||||
// Static members
|
// Static members
|
||||||
|
|
||||||
virtual List<word> const& elementTypes() const
|
virtual wordList const& elementTypes() const
|
||||||
{
|
{
|
||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
@ -292,16 +292,16 @@ public:
|
||||||
void writeScalarField
|
void writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile&,
|
ensightFile&,
|
||||||
const List<scalar>& field
|
const scalarList& field
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- write vector field components
|
//- write vector field components
|
||||||
void writeVectorField
|
void writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile&,
|
ensightFile&,
|
||||||
const List<scalar>& field0,
|
const scalarList& field0,
|
||||||
const List<scalar>& field1,
|
const scalarList& field1,
|
||||||
const List<scalar>& field2
|
const scalarList& field2
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
static List<word> elemTypes_;
|
static wordList elemTypes_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -140,7 +140,7 @@ public:
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- static listing of the element types
|
//- static listing of the element types
|
||||||
virtual List<word> const& elementTypes() const
|
virtual wordList const& elementTypes() const
|
||||||
{
|
{
|
||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
static List<word> elemTypes_;
|
static wordList elemTypes_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -120,7 +120,7 @@ public:
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- static listing of the element types
|
//- static listing of the element types
|
||||||
virtual List<word> const& elementTypes() const
|
virtual wordList const& elementTypes() const
|
||||||
{
|
{
|
||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,8 @@ void Foam::ensightPart::writeHeader
|
||||||
void Foam::ensightPart::writeFieldList
|
void Foam::ensightPart::writeFieldList
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field,
|
const scalarList& field,
|
||||||
const List<label>& idList
|
const labelList& idList
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forAll(idList, i)
|
forAll(idList, i)
|
||||||
|
@ -172,7 +172,7 @@ void Foam::ensightPart::writeGeometry(ensightGeoFile& os) const
|
||||||
void Foam::ensightPart::writeScalarField
|
void Foam::ensightPart::writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field
|
const scalarList& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (size() && field.size() && (os.allowUndef() || isFieldDefined(field)))
|
if (size() && field.size() && (os.allowUndef() || isFieldDefined(field)))
|
||||||
|
@ -196,9 +196,9 @@ void Foam::ensightPart::writeScalarField
|
||||||
void Foam::ensightPart::writeVectorField
|
void Foam::ensightPart::writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field0,
|
const scalarList& field0,
|
||||||
const List<scalar>& field1,
|
const scalarList& field1,
|
||||||
const List<scalar>& field2
|
const scalarList& field2
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0)))
|
if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0)))
|
||||||
|
|
|
@ -248,7 +248,7 @@ void Foam::ensightParts::writeData(Ostream& os) const
|
||||||
void Foam::ensightParts::writeScalarField
|
void Foam::ensightParts::writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field,
|
const scalarList& field,
|
||||||
bool useFaceData
|
bool useFaceData
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
@ -270,9 +270,9 @@ void Foam::ensightParts::writeScalarField
|
||||||
void Foam::ensightParts::writeVectorField
|
void Foam::ensightParts::writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
const List<scalar>& field0,
|
const scalarList& field0,
|
||||||
const List<scalar>& field1,
|
const scalarList& field1,
|
||||||
const List<scalar>& field2,
|
const scalarList& field2,
|
||||||
bool useFaceData
|
bool useFaceData
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ public:
|
||||||
void writeScalarField
|
void writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile&,
|
ensightFile&,
|
||||||
const List<scalar>& field,
|
const scalarList& field,
|
||||||
bool useFaceData = false
|
bool useFaceData = false
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
@ -120,9 +120,9 @@ public:
|
||||||
void writeVectorField
|
void writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile&,
|
ensightFile&,
|
||||||
const List<scalar>& field0,
|
const scalarList& field0,
|
||||||
const List<scalar>& field1,
|
const scalarList& field1,
|
||||||
const List<scalar>& field2,
|
const scalarList& field2,
|
||||||
bool useFaceData = false
|
bool useFaceData = false
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ void Foam::meshReader::createPolyBoundary()
|
||||||
else if (patchPhysicalTypes_[patchI] == "monitoring")
|
else if (patchPhysicalTypes_[patchI] == "monitoring")
|
||||||
{
|
{
|
||||||
// translate the "monitoring" pseudo-boundaries to face sets
|
// translate the "monitoring" pseudo-boundaries to face sets
|
||||||
List<label> monitoring(idList.size());
|
labelList monitoring(idList.size());
|
||||||
|
|
||||||
label monitorI = 0;
|
label monitorI = 0;
|
||||||
forAll(idList, bndI)
|
forAll(idList, bndI)
|
||||||
|
|
|
@ -103,7 +103,7 @@ void Foam::meshReader::addFaceZones(polyMesh& mesh) const
|
||||||
(
|
(
|
||||||
iter.key(),
|
iter.key(),
|
||||||
iter(),
|
iter(),
|
||||||
List<bool>(iter().size(), false),
|
boolList(iter().size(), false),
|
||||||
nZone,
|
nZone,
|
||||||
mesh.faceZones()
|
mesh.faceZones()
|
||||||
)
|
)
|
||||||
|
|
|
@ -220,7 +220,7 @@ private:
|
||||||
|
|
||||||
void writeInterfaces(const objectRegistry&) const;
|
void writeInterfaces(const objectRegistry&) const;
|
||||||
|
|
||||||
//- Write List<label> in constant/polyMesh
|
//- Write labelList in constant/polyMesh
|
||||||
void writeMeshLabelList
|
void writeMeshLabelList
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
|
|
|
@ -149,7 +149,7 @@ void Foam::meshReader::writeAux(const objectRegistry& registry) const
|
||||||
cellTable_.writeDict(registry);
|
cellTable_.writeDict(registry);
|
||||||
writeInterfaces(registry);
|
writeInterfaces(registry);
|
||||||
|
|
||||||
// write origCellId as List<label>
|
// write origCellId as labelList
|
||||||
writeMeshLabelList
|
writeMeshLabelList
|
||||||
(
|
(
|
||||||
registry,
|
registry,
|
||||||
|
@ -158,7 +158,7 @@ void Foam::meshReader::writeAux(const objectRegistry& registry) const
|
||||||
IOstream::BINARY
|
IOstream::BINARY
|
||||||
);
|
);
|
||||||
|
|
||||||
// write cellTableId as List<label>
|
// write cellTableId as labelList
|
||||||
// this is crucial for later conversion back to ccm/starcd
|
// this is crucial for later conversion back to ccm/starcd
|
||||||
writeMeshLabelList
|
writeMeshLabelList
|
||||||
(
|
(
|
||||||
|
|
|
@ -640,9 +640,9 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
|
||||||
label lineLabel, starCellId, cellFaceId, starRegion, configNumber;
|
label lineLabel, starCellId, cellFaceId, starRegion, configNumber;
|
||||||
word patchType;
|
word patchType;
|
||||||
|
|
||||||
labelList mapToFoamPatchId(1000, -1);
|
labelList mapToFoamPatchId(1000, label(-1));
|
||||||
labelList nPatchFaces(1000, 0);
|
labelList nPatchFaces(1000, label(0));
|
||||||
labelList origRegion(1000, 0);
|
labelList origRegion(1000, label(0));
|
||||||
patchTypes_.setSize(1000);
|
patchTypes_.setSize(1000);
|
||||||
|
|
||||||
// this is what we seem to need
|
// this is what we seem to need
|
||||||
|
|
|
@ -90,7 +90,7 @@ class cellTable
|
||||||
Map<label> zoneMap() const;
|
Map<label> zoneMap() const;
|
||||||
|
|
||||||
//- A contiguous list of cellTable names
|
//- A contiguous list of cellTable names
|
||||||
List<word> namesList() const;
|
wordList namesList() const;
|
||||||
|
|
||||||
//- Add required entries - MaterialType
|
//- Add required entries - MaterialType
|
||||||
void addDefaults();
|
void addDefaults();
|
||||||
|
|
|
@ -293,7 +293,7 @@ void Foam::meshWriters::STARCD::writeCells(const fileName& prefix) const
|
||||||
const labelList& cFaces = cells[cellId];
|
const labelList& cFaces = cells[cellId];
|
||||||
|
|
||||||
// create (beg,end) indices
|
// create (beg,end) indices
|
||||||
List<label> indices(cFaces.size() + 1);
|
labelList indices(cFaces.size() + 1);
|
||||||
indices[0] = indices.size();
|
indices[0] = indices.size();
|
||||||
|
|
||||||
label count = indices.size();
|
label count = indices.size();
|
||||||
|
|
|
@ -154,7 +154,7 @@ void Foam::mgMeshLevel::makeChild() const
|
||||||
);
|
);
|
||||||
|
|
||||||
// MGridGen agglomeration options.
|
// MGridGen agglomeration options.
|
||||||
List<int> options(4, 0);
|
List<int> options(4);
|
||||||
options[0] = 4; // globular agglom
|
options[0] = 4; // globular agglom
|
||||||
options[1] = 6; // objective F3 and F2
|
options[1] = 6; // objective F3 and F2
|
||||||
options[2] = 128; // debugging output level
|
options[2] = 128; // debugging output level
|
||||||
|
|
|
@ -46,8 +46,8 @@ namespace Foam
|
||||||
void Foam::decompositionMethod::calcCSR
|
void Foam::decompositionMethod::calcCSR
|
||||||
(
|
(
|
||||||
const labelListList& cellCells,
|
const labelListList& cellCells,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Count number of internal faces
|
// Count number of internal faces
|
||||||
|
@ -88,8 +88,8 @@ void Foam::decompositionMethod::calcCSR
|
||||||
void Foam::decompositionMethod::calcCSR
|
void Foam::decompositionMethod::calcCSR
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Make Metis CSR (Compressed Storage Format) storage
|
// Make Metis CSR (Compressed Storage Format) storage
|
||||||
|
@ -185,8 +185,8 @@ void Foam::decompositionMethod::calcCSR
|
||||||
void Foam::decompositionMethod::calcDistributedCSR
|
void Foam::decompositionMethod::calcDistributedCSR
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Create global cell numbers
|
// Create global cell numbers
|
||||||
|
@ -210,7 +210,7 @@ void Foam::decompositionMethod::calcDistributedCSR
|
||||||
// Get renumbered owner on other side of coupled faces
|
// Get renumbered owner on other side of coupled faces
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
List<int> globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,7 @@ void Foam::decompositionMethod::calcDistributedCSR
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
// Number of faces per cell
|
// Number of faces per cell
|
||||||
List<int> nFacesPerCell(mesh.nCells(), 0);
|
labelList nFacesPerCell(mesh.nCells(), 0);
|
||||||
|
|
||||||
// Number of coupled faces
|
// Number of coupled faces
|
||||||
label nCoupledFaces = 0;
|
label nCoupledFaces = 0;
|
||||||
|
@ -272,7 +272,7 @@ void Foam::decompositionMethod::calcDistributedCSR
|
||||||
|
|
||||||
xadj.setSize(mesh.nCells() + 1);
|
xadj.setSize(mesh.nCells() + 1);
|
||||||
|
|
||||||
int freeAdj = 0;
|
label freeAdj = 0;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,8 +63,8 @@ protected:
|
||||||
static void calcCSR
|
static void calcCSR
|
||||||
(
|
(
|
||||||
const labelListList& globalCellCells,
|
const labelListList& globalCellCells,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Helper: convert local connectivity from the mesh
|
//- Helper: convert local connectivity from the mesh
|
||||||
|
@ -73,8 +73,8 @@ protected:
|
||||||
static void calcCSR
|
static void calcCSR
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Helper: convert mesh connectivity into distributed CSR
|
//- Helper: convert mesh connectivity into distributed CSR
|
||||||
|
@ -82,8 +82,8 @@ protected:
|
||||||
static void calcDistributedCSR
|
static void calcDistributedCSR
|
||||||
(
|
(
|
||||||
const polyMesh&,
|
const polyMesh&,
|
||||||
List<int>& adjncy,
|
labelList& adjncy,
|
||||||
List<int>& xadj
|
labelList& xadj
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Helper: determine (non-parallel) cellCells from mesh
|
//- Helper: determine (non-parallel) cellCells from mesh
|
||||||
|
|
|
@ -97,7 +97,7 @@ void Foam::hierarchGeomDecomp::setDecompOrder()
|
||||||
|
|
||||||
Foam::label Foam::hierarchGeomDecomp::findLower
|
Foam::label Foam::hierarchGeomDecomp::findLower
|
||||||
(
|
(
|
||||||
const List<scalar>& l,
|
const scalarList& l,
|
||||||
const scalar t,
|
const scalar t,
|
||||||
const label initLow,
|
const label initLow,
|
||||||
const label initHigh
|
const label initHigh
|
||||||
|
@ -179,7 +179,7 @@ void Foam::hierarchGeomDecomp::calculateSortedWeightedSizes
|
||||||
void Foam::hierarchGeomDecomp::findBinary
|
void Foam::hierarchGeomDecomp::findBinary
|
||||||
(
|
(
|
||||||
const label sizeTol,
|
const label sizeTol,
|
||||||
const List<scalar>& values,
|
const scalarList& values,
|
||||||
const label minIndex, // index of previous value
|
const label minIndex, // index of previous value
|
||||||
const scalar minValue, // value at minIndex
|
const scalar minValue, // value at minIndex
|
||||||
const scalar maxValue, // global max of values
|
const scalar maxValue, // global max of values
|
||||||
|
@ -253,8 +253,8 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||||
void Foam::hierarchGeomDecomp::findBinary
|
void Foam::hierarchGeomDecomp::findBinary
|
||||||
(
|
(
|
||||||
const label sizeTol,
|
const label sizeTol,
|
||||||
const List<scalar>& sortedWeightedSizes,
|
const scalarList& sortedWeightedSizes,
|
||||||
const List<scalar>& values,
|
const scalarList& values,
|
||||||
const label minIndex, // index of previous value
|
const label minIndex, // index of previous value
|
||||||
const scalar minValue, // value at minIndex
|
const scalar minValue, // value at minIndex
|
||||||
const scalar maxValue, // global max of values
|
const scalar maxValue, // global max of values
|
||||||
|
|
|
@ -100,7 +100,7 @@ class hierarchGeomDecomp
|
||||||
//- Find index of t in list inbetween indices left and right
|
//- Find index of t in list inbetween indices left and right
|
||||||
static label findLower
|
static label findLower
|
||||||
(
|
(
|
||||||
const List<scalar>&,
|
const scalarList&,
|
||||||
const scalar t,
|
const scalar t,
|
||||||
const label left,
|
const label left,
|
||||||
const label right
|
const label right
|
||||||
|
@ -112,7 +112,7 @@ class hierarchGeomDecomp
|
||||||
static void findBinary
|
static void findBinary
|
||||||
(
|
(
|
||||||
const label sizeTol, // Acceptable size difference
|
const label sizeTol, // Acceptable size difference
|
||||||
const List<scalar>&,
|
const scalarList&,
|
||||||
const label leftIndex, // index of previous value
|
const label leftIndex, // index of previous value
|
||||||
const scalar leftValue, // value at leftIndex
|
const scalar leftValue, // value at leftIndex
|
||||||
const scalar maxValue, // global max of values
|
const scalar maxValue, // global max of values
|
||||||
|
@ -127,8 +127,8 @@ class hierarchGeomDecomp
|
||||||
static void findBinary
|
static void findBinary
|
||||||
(
|
(
|
||||||
const label sizeTol, // Acceptable size difference
|
const label sizeTol, // Acceptable size difference
|
||||||
const List<scalar>& sortedWeightedSizes,
|
const scalarList& sortedWeightedSizes,
|
||||||
const List<scalar>&,
|
const scalarList&,
|
||||||
const label leftIndex, // index of previous value
|
const label leftIndex, // index of previous value
|
||||||
const scalar leftValue, // value at leftIndex
|
const scalar leftValue, // value at leftIndex
|
||||||
const scalar maxValue, // global max of values
|
const scalar maxValue, // global max of values
|
||||||
|
|
|
@ -54,10 +54,10 @@ namespace Foam
|
||||||
|
|
||||||
Foam::label Foam::metisDecomp::decompose
|
Foam::label Foam::metisDecomp::decompose
|
||||||
(
|
(
|
||||||
const List<int>& adjncy,
|
const labelList& adjncy,
|
||||||
const List<int>& xadj,
|
const labelList& xadj,
|
||||||
const scalarField& cWeights,
|
const scalarField& cWeights,
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Method of decomposition
|
// Method of decomposition
|
||||||
|
@ -65,7 +65,7 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
// k-way: multi-level k-way
|
// k-way: multi-level k-way
|
||||||
word method("k-way");
|
word method("k-way");
|
||||||
|
|
||||||
int numCells = xadj.size()-1;
|
label numCells = xadj.size()-1;
|
||||||
|
|
||||||
// decomposition options. 0 = use defaults
|
// decomposition options. 0 = use defaults
|
||||||
idx_t options[METIS_NOPTIONS];
|
idx_t options[METIS_NOPTIONS];
|
||||||
|
@ -76,10 +76,10 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
Field<real_t> processorWeights;
|
Field<real_t> processorWeights;
|
||||||
|
|
||||||
// cell weights (so on the vertices of the dual)
|
// cell weights (so on the vertices of the dual)
|
||||||
List<int> cellWeights;
|
labelList cellWeights;
|
||||||
|
|
||||||
// face weights (so on the edges of the dual)
|
// face weights (so on the edges of the dual)
|
||||||
List<int> faceWeights;
|
labelList faceWeights;
|
||||||
|
|
||||||
|
|
||||||
// Check for externally provided cellweights and if so initialise weights
|
// Check for externally provided cellweights and if so initialise weights
|
||||||
|
@ -177,7 +177,7 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
{
|
{
|
||||||
Info<< "metisDecomp : Using cell-based weights." << endl;
|
Info<< "metisDecomp : Using cell-based weights." << endl;
|
||||||
|
|
||||||
IOList<int> cellIOWeights
|
IOList<label> cellIOWeights
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
|
@ -200,17 +200,17 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int nProcs = nProcessors_;
|
label nProcs = nProcessors_;
|
||||||
|
|
||||||
// output: cell -> processor addressing
|
// output: cell -> processor addressing
|
||||||
finalDecomp.setSize(numCells);
|
finalDecomp.setSize(numCells);
|
||||||
|
|
||||||
// output: number of cut edges
|
// output: number of cut edges
|
||||||
int edgeCut = 0;
|
label edgeCut = 0;
|
||||||
|
|
||||||
// Vertex weight info
|
// Vertex weight info
|
||||||
int* vwgtPtr = nullptr;
|
label* vwgtPtr = nullptr;
|
||||||
int* adjwgtPtr = nullptr;
|
label* adjwgtPtr = nullptr;
|
||||||
|
|
||||||
if (cellWeights.size())
|
if (cellWeights.size())
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
adjwgtPtr = faceWeights.begin();
|
adjwgtPtr = faceWeights.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
int one = 1;
|
label one = 1;
|
||||||
|
|
||||||
if (method == "recursive")
|
if (method == "recursive")
|
||||||
{
|
{
|
||||||
|
@ -229,8 +229,8 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
(
|
(
|
||||||
&numCells, // num vertices in graph
|
&numCells, // num vertices in graph
|
||||||
&one,
|
&one,
|
||||||
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
|
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
|
||||||
const_cast<List<int>&>(adjncy).begin(), // neighbour info
|
const_cast<List<label>&>(adjncy).begin(), // neighbour info
|
||||||
vwgtPtr, // vertexweights
|
vwgtPtr, // vertexweights
|
||||||
nullptr,
|
nullptr,
|
||||||
adjwgtPtr, // no edgeweights
|
adjwgtPtr, // no edgeweights
|
||||||
|
@ -248,8 +248,8 @@ Foam::label Foam::metisDecomp::decompose
|
||||||
(
|
(
|
||||||
&numCells, // num vertices in graph
|
&numCells, // num vertices in graph
|
||||||
&one,
|
&one,
|
||||||
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
|
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
|
||||||
const_cast<List<int>&>(adjncy).begin(), // neighbour info
|
const_cast<List<label>&>(adjncy).begin(), // neighbour info
|
||||||
vwgtPtr, // vertexweights
|
vwgtPtr, // vertexweights
|
||||||
nullptr,
|
nullptr,
|
||||||
adjwgtPtr, // no edgeweights
|
adjwgtPtr, // no edgeweights
|
||||||
|
@ -300,8 +300,8 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
calcCSR
|
calcCSR
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
|
@ -310,7 +310,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||||
);
|
);
|
||||||
|
|
||||||
// Decompose using default weights
|
// Decompose using default weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, pointWeights, finalDecomp);
|
decompose(adjncy, xadj, pointWeights, finalDecomp);
|
||||||
|
|
||||||
// Copy back to labelList
|
// Copy back to labelList
|
||||||
|
@ -348,8 +348,8 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||||
// Make Metis CSR (Compressed Storage Format) storage
|
// Make Metis CSR (Compressed Storage Format) storage
|
||||||
// adjncy : contains neighbours (= edges in graph)
|
// adjncy : contains neighbours (= edges in graph)
|
||||||
// xadj(celli) : start of information in adjncy for celli
|
// xadj(celli) : start of information in adjncy for celli
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
{
|
{
|
||||||
// Get cellCells on coarse mesh.
|
// Get cellCells on coarse mesh.
|
||||||
labelListList cellCells;
|
labelListList cellCells;
|
||||||
|
@ -365,7 +365,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decompose using default weights
|
// Decompose using default weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, coarseWeights, finalDecomp);
|
decompose(adjncy, xadj, coarseWeights, finalDecomp);
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,12 +406,12 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||||
// adjncy : contains neighbours (= edges in graph)
|
// adjncy : contains neighbours (= edges in graph)
|
||||||
// xadj(celli) : start of information in adjncy for celli
|
// xadj(celli) : start of information in adjncy for celli
|
||||||
|
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
calcCSR(globalCellCells, adjncy, xadj);
|
calcCSR(globalCellCells, adjncy, xadj);
|
||||||
|
|
||||||
// Decompose using default weights
|
// Decompose using default weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, cWeights, finalDecomp);
|
decompose(adjncy, xadj, cWeights, finalDecomp);
|
||||||
|
|
||||||
// Copy back to labelList
|
// Copy back to labelList
|
||||||
|
|
|
@ -63,10 +63,10 @@ class metisDecomp
|
||||||
|
|
||||||
label decompose
|
label decompose
|
||||||
(
|
(
|
||||||
const List<int>& adjncy,
|
const labelList& adjncy,
|
||||||
const List<int>& xadj,
|
const labelList& xadj,
|
||||||
const scalarField& cellWeights,
|
const scalarField& cellWeights,
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,20 +59,20 @@ namespace Foam
|
||||||
//- Does prevention of 0 cell domains and calls parmetis.
|
//- Does prevention of 0 cell domains and calls parmetis.
|
||||||
Foam::label Foam::parMetisDecomp::decompose
|
Foam::label Foam::parMetisDecomp::decompose
|
||||||
(
|
(
|
||||||
Field<int>& xadj,
|
Field<label>& xadj,
|
||||||
Field<int>& adjncy,
|
Field<label>& adjncy,
|
||||||
const pointField& cellCentres,
|
const pointField& cellCentres,
|
||||||
Field<int>& cellWeights,
|
Field<label>& cellWeights,
|
||||||
Field<int>& faceWeights,
|
Field<label>& faceWeights,
|
||||||
const List<int>& options,
|
const labelList& options,
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// C style numbering
|
// C style numbering
|
||||||
int numFlag = 0;
|
label numFlag = 0;
|
||||||
|
|
||||||
// Number of dimensions
|
// Number of dimensions
|
||||||
int nDims = 3;
|
label nDims = 3;
|
||||||
|
|
||||||
|
|
||||||
if (cellCentres.size() != xadj.size()-1)
|
if (cellCentres.size() != xadj.size()-1)
|
||||||
|
@ -85,14 +85,14 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// Get number of cells on all processors
|
// Get number of cells on all processors
|
||||||
List<int> nLocalCells(Pstream::nProcs());
|
labelList nLocalCells(Pstream::nProcs());
|
||||||
nLocalCells[Pstream::myProcNo()] = xadj.size()-1;
|
nLocalCells[Pstream::myProcNo()] = xadj.size()-1;
|
||||||
Pstream::gatherList(nLocalCells);
|
Pstream::gatherList(nLocalCells);
|
||||||
Pstream::scatterList(nLocalCells);
|
Pstream::scatterList(nLocalCells);
|
||||||
|
|
||||||
// Get cell offsets.
|
// Get cell offsets.
|
||||||
List<int> cellOffsets(Pstream::nProcs()+1);
|
labelList cellOffsets(Pstream::nProcs()+1);
|
||||||
int nGlobalCells = 0;
|
label nGlobalCells = 0;
|
||||||
forAll(nLocalCells, procI)
|
forAll(nLocalCells, procI)
|
||||||
{
|
{
|
||||||
cellOffsets[procI] = nGlobalCells;
|
cellOffsets[procI] = nGlobalCells;
|
||||||
|
@ -102,7 +102,7 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
// Convert pointField into the data type parMetis expects (float or double)
|
// Convert pointField into the data type parMetis expects (float or double)
|
||||||
Field<real_t> xyz(3*cellCentres.size());
|
Field<real_t> xyz(3*cellCentres.size());
|
||||||
int compI = 0;
|
label compI = 0;
|
||||||
forAll(cellCentres, cellI)
|
forAll(cellCentres, cellI)
|
||||||
{
|
{
|
||||||
const point& cc = cellCentres[cellI];
|
const point& cc = cellCentres[cellI];
|
||||||
|
@ -120,7 +120,7 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
// Number of cells to send to the next processor
|
// Number of cells to send to the next processor
|
||||||
// (is same as number of cells next processor has to receive)
|
// (is same as number of cells next processor has to receive)
|
||||||
List<int> nSendCells(Pstream::nProcs(), 0);
|
labelList nSendCells(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
for (label procI = nLocalCells.size()-1; procI >=1; procI--)
|
for (label procI = nLocalCells.size()-1; procI >=1; procI--)
|
||||||
{
|
{
|
||||||
|
@ -137,11 +137,11 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
// Receive cells from previous processor
|
// Receive cells from previous processor
|
||||||
IPstream fromPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
|
IPstream fromPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
|
||||||
|
|
||||||
Field<int> prevXadj(fromPrevProc);
|
Field<label> prevXadj(fromPrevProc);
|
||||||
Field<int> prevAdjncy(fromPrevProc);
|
Field<label> prevAdjncy(fromPrevProc);
|
||||||
Field<real_t> prevXyz(fromPrevProc);
|
Field<real_t> prevXyz(fromPrevProc);
|
||||||
Field<int> prevCellWeights(fromPrevProc);
|
Field<label> prevCellWeights(fromPrevProc);
|
||||||
Field<int> prevFaceWeights(fromPrevProc);
|
Field<label> prevFaceWeights(fromPrevProc);
|
||||||
|
|
||||||
if (prevXadj.size() != nSendCells[Pstream::myProcNo()-1])
|
if (prevXadj.size() != nSendCells[Pstream::myProcNo()-1])
|
||||||
{
|
{
|
||||||
|
@ -172,34 +172,34 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
// Send cells to next processor
|
// Send cells to next processor
|
||||||
OPstream toNextProc(Pstream::blocking, Pstream::myProcNo()+1);
|
OPstream toNextProc(Pstream::blocking, Pstream::myProcNo()+1);
|
||||||
|
|
||||||
int nCells = nSendCells[Pstream::myProcNo()];
|
label nCells = nSendCells[Pstream::myProcNo()];
|
||||||
int startCell = xadj.size()-1 - nCells;
|
label startCell = xadj.size()-1 - nCells;
|
||||||
int startFace = xadj[startCell];
|
label startFace = xadj[startCell];
|
||||||
int nFaces = adjncy.size()-startFace;
|
label nFaces = adjncy.size()-startFace;
|
||||||
|
|
||||||
// Send for all cell data: last nCells elements
|
// Send for all cell data: last nCells elements
|
||||||
// Send for all face data: last nFaces elements
|
// Send for all face data: last nFaces elements
|
||||||
toNextProc
|
toNextProc
|
||||||
<< Field<int>::subField(xadj, nCells, startCell)-startFace
|
<< Field<label>::subField(xadj, nCells, startCell)-startFace
|
||||||
<< Field<int>::subField(adjncy, nFaces, startFace)
|
<< Field<label>::subField(adjncy, nFaces, startFace)
|
||||||
<< SubField<real_t>(xyz, nDims*nCells, nDims*startCell)
|
<< SubField<real_t>(xyz, nDims*nCells, nDims*startCell)
|
||||||
<<
|
<<
|
||||||
(
|
(
|
||||||
cellWeights.size()
|
cellWeights.size()
|
||||||
? static_cast<const Field<int>&>
|
? static_cast<const Field<label>&>
|
||||||
(
|
(
|
||||||
Field<int>::subField(cellWeights, nCells, startCell)
|
Field<label>::subField(cellWeights, nCells, startCell)
|
||||||
)
|
)
|
||||||
: Field<int>(0)
|
: Field<label>(0)
|
||||||
)
|
)
|
||||||
<<
|
<<
|
||||||
(
|
(
|
||||||
faceWeights.size()
|
faceWeights.size()
|
||||||
? static_cast<const Field<int>&>
|
? static_cast<const Field<label>&>
|
||||||
(
|
(
|
||||||
Field<int>::subField(faceWeights, nFaces, startFace)
|
Field<label>::subField(faceWeights, nFaces, startFace)
|
||||||
)
|
)
|
||||||
: Field<int>(0)
|
: Field<label>(0)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Remove data that has been sent
|
// Remove data that has been sent
|
||||||
|
@ -248,9 +248,9 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
}
|
}
|
||||||
|
|
||||||
// Weight info
|
// Weight info
|
||||||
int wgtFlag = 0;
|
label wgtFlag = 0;
|
||||||
int* vwgtPtr = nullptr;
|
label* vwgtPtr = nullptr;
|
||||||
int* adjwgtPtr = nullptr;
|
label* adjwgtPtr = nullptr;
|
||||||
|
|
||||||
if (cellWeights.size())
|
if (cellWeights.size())
|
||||||
{
|
{
|
||||||
|
@ -265,7 +265,7 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// Number of weights or balance constraints
|
// Number of weights or balance constraints
|
||||||
int nCon = 1;
|
label nCon = 1;
|
||||||
// Per processor, per constraint the weight
|
// Per processor, per constraint the weight
|
||||||
Field<real_t> tpwgts(nCon*nProcessors_, 1./nProcessors_);
|
Field<real_t> tpwgts(nCon*nProcessors_, 1./nProcessors_);
|
||||||
// Imbalance tolerance
|
// Imbalance tolerance
|
||||||
|
@ -282,8 +282,10 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
finalDecomp.setSize(nLocalCells[Pstream::myProcNo()]);
|
finalDecomp.setSize(nLocalCells[Pstream::myProcNo()]);
|
||||||
|
|
||||||
// output: number of cut edges
|
// output: number of cut edges
|
||||||
int edgeCut = 0;
|
label edgeCut = 0;
|
||||||
|
|
||||||
|
// Number of parts
|
||||||
|
label nProcs = nProcessors_;
|
||||||
|
|
||||||
ParMETIS_V3_PartGeomKway
|
ParMETIS_V3_PartGeomKway
|
||||||
(
|
(
|
||||||
|
@ -297,10 +299,10 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
&nDims,
|
&nDims,
|
||||||
xyz.begin(),
|
xyz.begin(),
|
||||||
&nCon,
|
&nCon,
|
||||||
&nProcessors_, // nParts
|
&nProcs, // nParts
|
||||||
tpwgts.begin(),
|
tpwgts.begin(),
|
||||||
ubvec.begin(),
|
ubvec.begin(),
|
||||||
const_cast<List<int>&>(options).begin(),
|
const_cast<List<label>&>(options).begin(),
|
||||||
&edgeCut,
|
&edgeCut,
|
||||||
finalDecomp.begin(),
|
finalDecomp.begin(),
|
||||||
&comm
|
&comm
|
||||||
|
@ -315,7 +317,7 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
{
|
{
|
||||||
IPstream fromNextProc(Pstream::blocking, Pstream::myProcNo()+1);
|
IPstream fromNextProc(Pstream::blocking, Pstream::myProcNo()+1);
|
||||||
|
|
||||||
List<int> nextFinalDecomp(fromNextProc);
|
labelList nextFinalDecomp(fromNextProc);
|
||||||
|
|
||||||
if (nextFinalDecomp.size() != nSendCells[Pstream::myProcNo()])
|
if (nextFinalDecomp.size() != nSendCells[Pstream::myProcNo()])
|
||||||
{
|
{
|
||||||
|
@ -334,10 +336,10 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||||
{
|
{
|
||||||
OPstream toPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
|
OPstream toPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
|
||||||
|
|
||||||
int nToPrevious = nSendCells[Pstream::myProcNo()-1];
|
label nToPrevious = nSendCells[Pstream::myProcNo()-1];
|
||||||
|
|
||||||
toPrevProc <<
|
toPrevProc <<
|
||||||
SubList<int>
|
SubList<label>
|
||||||
(
|
(
|
||||||
finalDecomp,
|
finalDecomp,
|
||||||
nToPrevious,
|
nToPrevious,
|
||||||
|
@ -399,9 +401,9 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// Connections
|
// Connections
|
||||||
Field<int> adjncy;
|
Field<label> adjncy;
|
||||||
// Offsets into adjncy
|
// Offsets into adjncy
|
||||||
Field<int> xadj;
|
Field<label> xadj;
|
||||||
calcDistributedCSR
|
calcDistributedCSR
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
|
@ -411,16 +413,16 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// decomposition options. 0 = use defaults
|
// decomposition options. 0 = use defaults
|
||||||
List<int> options(3, 0);
|
labelList options(3, label(0));
|
||||||
//options[0] = 1; // don't use defaults but use values below
|
//options[0] = 1; // don't use defaults but use values below
|
||||||
//options[1] = -1; // full debug info
|
//options[1] = -1; // full debug info
|
||||||
//options[2] = 15; // random number seed
|
//options[2] = 15; // random number seed
|
||||||
|
|
||||||
// cell weights (so on the vertices of the dual)
|
// cell weights (so on the vertices of the dual)
|
||||||
Field<int> cellWeights;
|
Field<label> cellWeights;
|
||||||
|
|
||||||
// face weights (so on the edges of the dual)
|
// face weights (so on the edges of the dual)
|
||||||
Field<int> faceWeights;
|
Field<label> faceWeights;
|
||||||
|
|
||||||
|
|
||||||
// Check for externally provided cellweights and if so initialise weights
|
// Check for externally provided cellweights and if so initialise weights
|
||||||
|
@ -527,7 +529,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
faceWeights.setSize(adjncy.size());
|
faceWeights.setSize(adjncy.size());
|
||||||
|
|
||||||
// Assume symmetric weights. Keep same ordering as adjncy.
|
// Assume symmetric weights. Keep same ordering as adjncy.
|
||||||
List<int> nFacesPerCell(mesh_.nCells(), 0);
|
labelList nFacesPerCell(mesh_.nCells(), 0);
|
||||||
|
|
||||||
// Handle internal faces
|
// Handle internal faces
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||||
|
@ -581,7 +583,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// Do actual decomposition
|
// Do actual decomposition
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose
|
decompose
|
||||||
(
|
(
|
||||||
xadj,
|
xadj,
|
||||||
|
@ -636,7 +638,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
// Get renumbered owner region on other side of coupled faces
|
// Get renumbered owner region on other side of coupled faces
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
List<int> globalNeighbour(mesh_.nFaces()-mesh_.nInternalFaces());
|
labelList globalNeighbour(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
|
@ -781,24 +783,24 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
// Make Metis Distributed CSR (Compressed Storage Format) storage
|
// Make Metis Distributed CSR (Compressed Storage Format) storage
|
||||||
|
|
||||||
// Connections
|
// Connections
|
||||||
Field<int> adjncy;
|
Field<label> adjncy;
|
||||||
|
|
||||||
// Offsets into adjncy
|
// Offsets into adjncy
|
||||||
Field<int> xadj;
|
Field<label> xadj;
|
||||||
|
|
||||||
calcCSR(globalCellCells, adjncy, xadj);
|
calcCSR(globalCellCells, adjncy, xadj);
|
||||||
|
|
||||||
// decomposition options. 0 = use defaults
|
// decomposition options. 0 = use defaults
|
||||||
List<int> options(3, 0);
|
labelList options(3, label(0));
|
||||||
//options[0] = 1; // don't use defaults but use values below
|
//options[0] = 1; // don't use defaults but use values below
|
||||||
//options[1] = -1; // full debug info
|
//options[1] = -1; // full debug info
|
||||||
//options[2] = 15; // random number seed
|
//options[2] = 15; // random number seed
|
||||||
|
|
||||||
// cell weights (so on the vertices of the dual)
|
// cell weights (so on the vertices of the dual)
|
||||||
Field<int> cellWeights;
|
Field<label> cellWeights;
|
||||||
|
|
||||||
// face weights (so on the edges of the dual)
|
// face weights (so on the edges of the dual)
|
||||||
Field<int> faceWeights;
|
Field<label> faceWeights;
|
||||||
|
|
||||||
|
|
||||||
// Check for externally provided cellweights and if so initialise weights
|
// Check for externally provided cellweights and if so initialise weights
|
||||||
|
@ -860,7 +862,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
|
|
||||||
// Do actual decomposition
|
// Do actual decomposition
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose
|
decompose
|
||||||
(
|
(
|
||||||
xadj,
|
xadj,
|
||||||
|
|
|
@ -72,14 +72,14 @@ class parMetisDecomp
|
||||||
|
|
||||||
label decompose
|
label decompose
|
||||||
(
|
(
|
||||||
Field<int>& xadj,
|
Field<label>& xadj,
|
||||||
Field<int>& adjncy,
|
Field<label>& adjncy,
|
||||||
const pointField& cellCentres,
|
const pointField& cellCentres,
|
||||||
Field<int>& cellWeights,
|
Field<label>& cellWeights,
|
||||||
Field<int>& faceWeights,
|
Field<label>& faceWeights,
|
||||||
const List<int>& options,
|
const labelList& options,
|
||||||
|
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -164,11 +164,11 @@ void Foam::scotchDecomp::check(const int retVal, const char* str)
|
||||||
// Call scotch with options from dictionary.
|
// Call scotch with options from dictionary.
|
||||||
Foam::label Foam::scotchDecomp::decompose
|
Foam::label Foam::scotchDecomp::decompose
|
||||||
(
|
(
|
||||||
const List<int>& adjncy,
|
const labelList& adjncy,
|
||||||
const List<int>& xadj,
|
const labelList& xadj,
|
||||||
const scalarField& cWeights,
|
const scalarField& cWeights,
|
||||||
|
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Dump graph
|
// Dump graph
|
||||||
|
@ -247,7 +247,7 @@ Foam::label Foam::scotchDecomp::decompose
|
||||||
// Graph
|
// Graph
|
||||||
// ~~~~~
|
// ~~~~~
|
||||||
|
|
||||||
List<int> velotab;
|
labelList velotab;
|
||||||
|
|
||||||
|
|
||||||
// Check for externally provided cellweights and if so initialise weights
|
// Check for externally provided cellweights and if so initialise weights
|
||||||
|
@ -314,7 +314,7 @@ Foam::label Foam::scotchDecomp::decompose
|
||||||
SCOTCH_Arch archdat;
|
SCOTCH_Arch archdat;
|
||||||
check(SCOTCH_archInit(&archdat), "SCOTCH_archInit");
|
check(SCOTCH_archInit(&archdat), "SCOTCH_archInit");
|
||||||
|
|
||||||
List<label> processorWeights;
|
labelList processorWeights;
|
||||||
if (decompositionDict_.found("scotchCoeffs"))
|
if (decompositionDict_.found("scotchCoeffs"))
|
||||||
{
|
{
|
||||||
const dictionary& scotchCoeffs =
|
const dictionary& scotchCoeffs =
|
||||||
|
@ -443,12 +443,12 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||||
// Make Metis CSR (Compressed Storage Format) storage
|
// Make Metis CSR (Compressed Storage Format) storage
|
||||||
// adjncy : contains neighbours (= edges in graph)
|
// adjncy : contains neighbours (= edges in graph)
|
||||||
// xadj(celli) : start of information in adjncy for celli
|
// xadj(celli) : start of information in adjncy for celli
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
calcCSR(mesh_, adjncy, xadj);
|
calcCSR(mesh_, adjncy, xadj);
|
||||||
|
|
||||||
// Decompose using default weights
|
// Decompose using default weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, pointWeights, finalDecomp);
|
decompose(adjncy, xadj, pointWeights, finalDecomp);
|
||||||
|
|
||||||
// Copy back to labelList
|
// Copy back to labelList
|
||||||
|
@ -485,8 +485,8 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||||
// Make Metis CSR (Compressed Storage Format) storage
|
// Make Metis CSR (Compressed Storage Format) storage
|
||||||
// adjncy : contains neighbours (= edges in graph)
|
// adjncy : contains neighbours (= edges in graph)
|
||||||
// xadj(celli) : start of information in adjncy for celli
|
// xadj(celli) : start of information in adjncy for celli
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
{
|
{
|
||||||
// Get cellCells on coarse mesh.
|
// Get cellCells on coarse mesh.
|
||||||
labelListList cellCells;
|
labelListList cellCells;
|
||||||
|
@ -503,7 +503,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decompose using weights
|
// Decompose using weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, coarseWeights, finalDecomp);
|
decompose(adjncy, xadj, coarseWeights, finalDecomp);
|
||||||
|
|
||||||
// Rework back into decomposition for original mesh_
|
// Rework back into decomposition for original mesh_
|
||||||
|
@ -543,12 +543,12 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||||
// adjncy : contains neighbours (= edges in graph)
|
// adjncy : contains neighbours (= edges in graph)
|
||||||
// xadj(celli) : start of information in adjncy for celli
|
// xadj(celli) : start of information in adjncy for celli
|
||||||
|
|
||||||
List<int> adjncy;
|
labelList adjncy;
|
||||||
List<int> xadj;
|
labelList xadj;
|
||||||
calcCSR(globalCellCells, adjncy, xadj);
|
calcCSR(globalCellCells, adjncy, xadj);
|
||||||
|
|
||||||
// Decompose using weights
|
// Decompose using weights
|
||||||
List<int> finalDecomp;
|
labelList finalDecomp;
|
||||||
decompose(adjncy, xadj, cWeights, finalDecomp);
|
decompose(adjncy, xadj, cWeights, finalDecomp);
|
||||||
|
|
||||||
// Copy back to labelList
|
// Copy back to labelList
|
||||||
|
|
|
@ -68,10 +68,10 @@ class scotchDecomp
|
||||||
|
|
||||||
label decompose
|
label decompose
|
||||||
(
|
(
|
||||||
const List<int>& adjncy,
|
const labelList& adjncy,
|
||||||
const List<int>& xadj,
|
const labelList& xadj,
|
||||||
const scalarField& cWeights,
|
const scalarField& cWeights,
|
||||||
List<int>& finalDecomp
|
labelList& finalDecomp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ class CompactListList_dev
|
||||||
label size_;
|
label size_;
|
||||||
|
|
||||||
//- Offset table
|
//- Offset table
|
||||||
List<label> offsets_;
|
labelList offsets_;
|
||||||
|
|
||||||
//- Packed matrix of data
|
//- Packed matrix of data
|
||||||
List<T> m_;
|
List<T> m_;
|
||||||
|
@ -143,10 +143,10 @@ public:
|
||||||
inline bool empty() const;
|
inline bool empty() const;
|
||||||
|
|
||||||
//- Return the offset table (= size()+1)
|
//- Return the offset table (= size()+1)
|
||||||
inline const List<label>& offsets() const;
|
inline const labelList& offsets() const;
|
||||||
|
|
||||||
//- Return non-const access to the offset table
|
//- Return non-const access to the offset table
|
||||||
inline List<label>& offsets();
|
inline labelList& offsets();
|
||||||
|
|
||||||
//- Return the packed matrix of data
|
//- Return the packed matrix of data
|
||||||
inline const List<T>& m() const;
|
inline const List<T>& m() const;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue