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
c24035bc
Commit
c24035bc
authored
Apr 12, 2013
by
andy
Browse files
ENH: Added utility functions
parent
6000d2fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
View file @
c24035bc
...
...
@@ -28,6 +28,101 @@ License
#include
"meshTools.H"
#include
"mapDistribute.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<
class
SourcePatch
,
class
TargetPatch
>
Foam
::
word
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
;
}
default:
{
FatalErrorIn
(
"const Foam::word"
"Foam::AMIInterpolation<SourcePatch, TargetPatch>::"
"interpolationMethodToWord"
"("
"const interpolationMethod&"
")"
)
<<
"Unhandled interpolationMethod enumeration "
<<
method
<<
abort
(
FatalError
);
}
}
return
method
;
}
template
<
class
SourcePatch
,
class
TargetPatch
>
typename
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethod
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
wordTointerpolationMethod
(
const
word
&
im
)
{
interpolationMethod
method
=
imDirect
;
wordList
methods
(
IStringStream
(
"(directAMI mapNearestAMI faceAreaWeightAMI)"
)()
);
if
(
im
==
"directAMI"
)
{
method
=
imDirect
;
}
else
if
(
im
==
"mapNearestAMI"
)
{
method
=
imMapNearest
;
}
else
if
(
im
==
"faceAreaWeightAMI"
)
{
method
=
imFaceAreaWeight
;
}
else
{
FatalErrorIn
(
"Foam::AMIInterpolation<SourcePatch, TargetPatch>::"
"interpolationMethod"
"Foam::AMIInterpolation<SourcePatch, TargetPatch>::"
"wordTointerpolationMethod"
"("
"const word&"
")"
)
<<
"Invalid interpolationMethod "
<<
im
<<
". Valid methods are:"
<<
methods
<<
exit
(
FatalError
);
}
return
method
;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
<
class
SourcePatch
,
class
TargetPatch
>
...
...
@@ -634,52 +729,6 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::~AMIInterpolation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
SourcePatch
,
class
TargetPatch
>
Foam
::
word
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
;
}
default:
{
FatalErrorIn
(
"const Foam::word"
"Foam::AMIInterpolation<SourcePatch, TargetPatch>::"
"interpolationMethodToWord"
"("
"const interpolationMethod&"
") const"
)
<<
"Unhandled interpolationMethod enumeration "
<<
method
<<
abort
(
FatalError
);
}
}
return
method
;
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
update
(
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H
View file @
c24035bc
...
...
@@ -91,6 +91,18 @@ public:
imFaceAreaWeight
};
//- Convert interpolationMethod to word representation
static
word
interpolationMethodToWord
(
const
interpolationMethod
&
method
);
//- Convert word to interpolationMethod
static
interpolationMethod
wordTointerpolationMethod
(
const
word
&
method
);
private:
...
...
@@ -301,12 +313,6 @@ public:
// the AMI
label
singlePatchProc
()
const
;
//- Convert interpolationMethod to word representation
static
word
interpolationMethodToWord
(
const
interpolationMethod
&
method
);
// Source patch
...
...
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