Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
80ffdfb1
Commit
80ffdfb1
authored
Aug 17, 2017
by
Andrew Heather
Browse files
ENH: AMIInterpolation - updated to use Enum class
parent
e3d306d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
View file @
80ffdfb1
...
...
@@ -31,6 +31,20 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<
class
SourcePatch
,
class
TargetPatch
>
const
Foam
::
Enum
<
typename
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethod
>
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethodNames_
{
{
interpolationMethod
::
imDirect
,
"directAMI"
},
{
interpolationMethod
::
imMapNearest
,
"mapNearestAMI"
},
{
interpolationMethod
::
imFaceAreaWeight
,
"faceAreaWeightAMI"
},
{
interpolationMethod
::
imPartialFaceAreaWeight
,
"partialFaceAreaWeightAMI"
}
};
template
<
class
SourcePatch
,
class
TargetPatch
>
Foam
::
word
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethodToWord
...
...
@@ -38,39 +52,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolationMethodToWord
const
interpolationMethod
&
im
)
{
word
method
=
"unknown-interpolationMethod"
;
switch
(
im
)
{
case
imDirect
:
{
method
=
"directAMI"
;
break
;
}
case
imMapNearest
:
{
method
=
"mapNearestAMI"
;
break
;
}
case
imFaceAreaWeight
:
{
method
=
"faceAreaWeightAMI"
;
break
;
}
case
imPartialFaceAreaWeight
:
{
method
=
"partialFaceAreaWeightAMI"
;
break
;
}
default:
{
FatalErrorInFunction
<<
"Unhandled interpolationMethod enumeration "
<<
method
<<
abort
(
FatalError
);
}
}
return
method
;
return
interpolationMethodNames_
[
im
];
}
...
...
@@ -81,41 +63,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::wordTointerpolationMethod
const
word
&
im
)
{
interpolationMethod
method
=
imDirect
;
const
wordList
methods
{
"directAMI"
,
"mapNearestAMI"
,
"faceAreaWeightAMI"
,
"partialFaceAreaWeightAMI"
};
if
(
im
==
"directAMI"
)
{
method
=
imDirect
;
}
else
if
(
im
==
"mapNearestAMI"
)
{
method
=
imMapNearest
;
}
else
if
(
im
==
"faceAreaWeightAMI"
)
{
method
=
imFaceAreaWeight
;
}
else
if
(
im
==
"partialFaceAreaWeightAMI"
)
{
method
=
imPartialFaceAreaWeight
;
}
else
{
FatalErrorInFunction
<<
"Invalid interpolationMethod "
<<
im
<<
". Valid methods are:"
<<
methods
<<
exit
(
FatalError
);
}
return
method
;
return
interpolationMethodNames_
[
im
];
}
...
...
@@ -910,11 +858,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
if
(
srcTotalSize
==
0
)
{
if
(
debug
)
{
Info
<<
"AMI: no source faces present - no addressing constructed"
<<
endl
;
}
DebugInfo
<<
"AMI: no source faces present - no addressing constructed"
<<
endl
;
return
;
}
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H
View file @
80ffdfb1
...
...
@@ -57,6 +57,7 @@ SourceFiles
#include
"faceAreaIntersect.H"
#include
"globalIndex.H"
#include
"ops.H"
#include
"Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -92,6 +93,8 @@ public:
imPartialFaceAreaWeight
};
static
const
Enum
<
interpolationMethod
>
interpolationMethodNames_
;
//- Convert interpolationMethod to word representation
static
word
interpolationMethodToWord
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment