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
Community
integration-cfmesh
Commits
d791e0d0
Commit
d791e0d0
authored
May 21, 2015
by
Franjo
Browse files
Replaced ranslationDistance with scalingDistancefor plane anisotropic
source
parent
0ffd68b6
Changes
5
Hide whitespace changes
Inline
Side-by-side
meshLibrary/Make/files
View file @
d791e0d0
...
...
@@ -164,7 +164,7 @@ $(polyMeshGen2DEngine)/polyMeshGen2DEngine.C
$(coordinateModification)/coordinateModification.C
$(coordinateModification)/newCoordinateModification.C
$(coordinateModification)/plane
Translation
.C
$(coordinateModification)/plane
Scaling
.C
$(coordinateModification)/boxScaling.C
$(edgeMeshGeometryModification)/edgeMeshGeometryModification.C
...
...
meshLibrary/utilities/anisotropicMeshing/coordinateModification/plane
Translation
.C
→
meshLibrary/utilities/anisotropicMeshing/coordinateModification/plane
Scaling
.C
View file @
d791e0d0
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"plane
Translation
.H"
#include
"plane
Scaling
.H"
#include
"addToRunTimeSelectionTable.H"
#include
"boundBox.H"
#include
"plane.H"
...
...
@@ -33,38 +33,38 @@ License
namespace
Foam
{
defineTypeNameAndDebug
(
plane
Translation
,
0
);
defineTypeNameAndDebug
(
plane
Scaling
,
0
);
addToRunTimeSelectionTable
(
coordinateModification
,
plane
Translation
,
plane
Scaling
,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
plane
Translation
::
planeTranslation
()
plane
Scaling
::
planeScaling
()
:
coordinateModification
(),
origin_
(
vector
::
zero
),
normal_
(
1
,
1
,
1
),
translation
Distance_
(
0
.
0
),
scaling
Distance_
(
0
.
0
),
scalingFactor_
(
1
.
0
)
{}
plane
Translation
::
planeTranslation
plane
Scaling
::
planeScaling
(
const
word
&
name
,
const
point
&
origin
,
const
vector
&
normal
,
const
scalar
translation
Distance
,
const
scalar
scaling
Distance
,
const
scalar
scalingFactor
)
:
coordinateModification
(),
origin_
(
origin
),
normal_
(
normal
/
mag
(
normal
)),
translationDistance_
(
translation
Distance
),
scalingDistance_
(
scaling
Distance
),
scalingFactor_
(
scalingFactor
)
{
if
(
scalingFactor_
<
SMALL
)
...
...
@@ -78,7 +78,7 @@ planeTranslation::planeTranslation
setName
(
name
);
}
plane
Translation
::
planeTranslation
plane
Scaling
::
planeScaling
(
const
word
&
name
,
const
dictionary
&
dict
...
...
@@ -91,59 +91,59 @@ planeTranslation::planeTranslation
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
point
plane
Translation
::
origin
()
const
point
plane
Scaling
::
origin
()
const
{
return
origin_
;
}
void
plane
Translation
::
translateAndModifyObject
(
const
vector
&
disp
)
void
plane
Scaling
::
translateAndModifyObject
(
const
vector
&
disp
)
{
origin_
+=
disp
;
translation
Distance_
/=
scalingFactor_
;
scaling
Distance_
/=
scalingFactor_
;
}
vector
plane
Translation
::
displacement
(
const
point
&
p
)
const
vector
plane
Scaling
::
displacement
(
const
point
&
p
)
const
{
const
scalar
dist
=
(
p
-
origin_
)
&
normal_
;
const
vector
translationVec
=
normal_
*
translation
Distance_
*
((
1
.
0
/
scalingFactor_
)
-
1
.
0
);
normal_
*
scaling
Distance_
*
((
1
.
0
/
scalingFactor_
)
-
1
.
0
);
const
scalar
t
=
dist
/
translation
Distance_
;
const
scalar
t
=
dist
/
scaling
Distance_
;
const
scalar
tBnd
=
Foam
::
max
(
0
.
0
,
Foam
::
min
(
1
.
0
,
t
));
return
tBnd
*
translationVec
;
}
vector
plane
Translation
::
backwardDisplacement
(
const
point
&
p
)
const
vector
plane
Scaling
::
backwardDisplacement
(
const
point
&
p
)
const
{
const
scalar
dist
=
(
p
-
origin_
)
&
normal_
;
const
vector
translationVec
=
normal_
*
translation
Distance_
*
(
scalingFactor_
-
1
.
0
);
normal_
*
scaling
Distance_
*
(
scalingFactor_
-
1
.
0
);
const
scalar
t
=
dist
/
translation
Distance_
;
const
scalar
t
=
dist
/
scaling
Distance_
;
const
scalar
tBnd
=
Foam
::
max
(
0
.
0
,
Foam
::
min
(
1
.
0
,
t
));
return
tBnd
*
translationVec
;
}
bool
plane
Translation
::
combiningPossible
()
const
bool
plane
Scaling
::
combiningPossible
()
const
{
return
true
;
}
void
plane
Translation
::
boundingPlanes
(
PtrList
<
plane
>&
pl
)
const
void
plane
Scaling
::
boundingPlanes
(
PtrList
<
plane
>&
pl
)
const
{
if
(
Foam
::
mag
(
scalingFactor_
-
1
.
0
)
>
VSMALL
)
{
pl
.
setSize
(
2
);
pl
.
set
(
0
,
new
plane
(
origin_
,
normal_
));
pl
.
set
(
1
,
new
plane
(
origin_
+
translation
Distance_
*
normal_
,
normal_
));
pl
.
set
(
1
,
new
plane
(
origin_
+
scaling
Distance_
*
normal_
,
normal_
));
}
else
{
...
...
@@ -153,7 +153,7 @@ void planeTranslation::boundingPlanes(PtrList<plane>& pl) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionary
plane
Translation
::
dict
(
bool
ignoreType
)
const
dictionary
plane
Scaling
::
dict
(
bool
ignoreType
)
const
{
dictionary
dict
;
...
...
@@ -161,22 +161,22 @@ dictionary planeTranslation::dict(bool ignoreType) const
dict
.
add
(
"origin"
,
origin_
);
dict
.
add
(
"normal"
,
normal_
);
dict
.
add
(
"
translationDistance"
,
translation
Distance_
);
dict
.
add
(
"
scalingDistance"
,
scaling
Distance_
);
dict
.
add
(
"scalingFactor"
,
scalingFactor_
);
return
dict
;
}
void
plane
Translation
::
write
(
Ostream
&
os
)
const
void
plane
Scaling
::
write
(
Ostream
&
os
)
const
{
os
<<
" type: "
<<
type
()
<<
" origin: "
<<
origin_
<<
" normal: "
<<
normal_
<<
"
translation
Distance: "
<<
translation
Distance_
<<
"
scaling
Distance: "
<<
scaling
Distance_
<<
" scalingFactor: "
<<
scalingFactor_
;
}
void
plane
Translation
::
writeDict
(
Ostream
&
os
,
bool
subDict
)
const
void
plane
Scaling
::
writeDict
(
Ostream
&
os
,
bool
subDict
)
const
{
if
(
subDict
)
{
...
...
@@ -191,7 +191,7 @@ void planeTranslation::writeDict(Ostream& os, bool subDict) const
os
.
writeKeyword
(
"origin"
)
<<
origin_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"normal"
)
<<
normal_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"
translation
Dista
m
ce"
)
<<
translation
Distance_
os
.
writeKeyword
(
"
scaling
Dista
n
ce"
)
<<
scaling
Distance_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"scalingFactor"
)
<<
scalingFactor_
<<
token
::
END_STATEMENT
<<
nl
;
...
...
@@ -202,7 +202,7 @@ void planeTranslation::writeDict(Ostream& os, bool subDict) const
}
}
void
plane
Translation
::
operator
=
(
const
dictionary
&
d
)
void
plane
Scaling
::
operator
=
(
const
dictionary
&
d
)
{
// allow as embedded sub-dictionary "coordinateSystem"
const
dictionary
&
dict
=
...
...
@@ -221,7 +221,7 @@ void planeTranslation::operator=(const dictionary& d)
{
FatalErrorIn
(
"void plane
Translation
::operator=(const dictionary& d)"
"void plane
Scaling
::operator=(const dictionary& d)"
)
<<
"Entry origin is not specified!"
<<
exit
(
FatalError
);
origin_
=
vector
::
zero
;
...
...
@@ -236,25 +236,25 @@ void planeTranslation::operator=(const dictionary& d)
{
FatalErrorIn
(
"void plane
Translation
::operator=(const dictionary& d)"
"void plane
Scaling
::operator=(const dictionary& d)"
)
<<
"Entry lengthX is not specified!"
<<
exit
(
FatalError
);
normal_
=
vector
(
1
,
1
,
1
);
}
// specify translation distance
if
(
dict
.
found
(
"
translation
Distance"
)
)
if
(
dict
.
found
(
"
scaling
Distance"
)
)
{
translation
Distance_
=
readScalar
(
dict
.
lookup
(
"
translation
Distance"
));
scaling
Distance_
=
readScalar
(
dict
.
lookup
(
"
scaling
Distance"
));
}
else
{
FatalErrorIn
(
"void plane
Translation
::operator=(const dictionary& d)"
)
<<
"Entry
translation
Distance is not specified!"
<<
exit
(
FatalError
);
"void plane
Scaling
::operator=(const dictionary& d)"
)
<<
"Entry
scaling
Distance is not specified!"
<<
exit
(
FatalError
);
translation
Distance_
=
0
.
0
;
scaling
Distance_
=
0
.
0
;
}
// specify scaling factor
...
...
@@ -266,7 +266,7 @@ void planeTranslation::operator=(const dictionary& d)
{
WarningIn
(
"void plane
Translation
::operator=(const dictionary& d)"
"void plane
Scaling
::operator=(const dictionary& d)"
)
<<
"Entry scalingFactor is not specified!"
<<
endl
;
scalingFactor_
=
1
.
0
;
...
...
@@ -275,14 +275,14 @@ void planeTranslation::operator=(const dictionary& d)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Ostream
&
plane
Translation
::
operator
<<
(
Ostream
&
os
)
const
Ostream
&
plane
Scaling
::
operator
<<
(
Ostream
&
os
)
const
{
os
<<
"name "
<<
name
()
<<
nl
;
write
(
os
);
return
os
;
}
Ostream
&
operator
<<
(
Ostream
&
os
,
const
plane
Translation
&
pt
)
Ostream
&
operator
<<
(
Ostream
&
os
,
const
plane
Scaling
&
pt
)
{
return
pt
.
operator
<<
(
os
);
}
...
...
meshLibrary/utilities/anisotropicMeshing/coordinateModification/plane
Translation
.H
→
meshLibrary/utilities/anisotropicMeshing/coordinateModification/plane
Scaling
.H
View file @
d791e0d0
...
...
@@ -22,18 +22,19 @@ License
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
Class
plane
Translation
plane
Scaling
Description
Applies translation to points on the positive side of the plane.
Applies scaling to points on the positive side of the plane within
the scaling distance.
SourceFiles
plane
Translation
.C
plane
Scaling
.C
\*---------------------------------------------------------------------------*/
#ifndef plane
Translation
_H
#define plane
Translation
_H
#ifndef plane
Scaling
_H
#define plane
Scaling
_H
#include
"coordinateModification.H"
...
...
@@ -43,10 +44,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class plane
Translation
Declaration
Class plane
Scaling
Declaration
\*---------------------------------------------------------------------------*/
class
plane
Translation
class
plane
Scaling
:
public
coordinateModification
{
...
...
@@ -57,8 +58,8 @@ class planeTranslation
//- normal vector
vector
normal_
;
//-
translation
distance
scalar
translation
Distance_
;
//-
scaling
distance
scalar
scaling
Distance_
;
//- scaling factor
scalar
scalingFactor_
;
...
...
@@ -72,35 +73,35 @@ public:
// Constructors
//- Null construct
plane
Translation
();
plane
Scaling
();
//- Construct from name, origin, normal, translation distance and scale
plane
Translation
plane
Scaling
(
const
word
&
name
,
const
point
&
original
,
const
vector
&
normal
,
const
scalar
translation
Distance
,
const
scalar
scaling
Distance
,
const
scalar
scalingFactor
);
//- Construct from dictionary
plane
Translation
(
const
word
&
name
,
const
dictionary
&
dict
);
plane
Scaling
(
const
word
&
name
,
const
dictionary
&
dict
);
//- Construct and return a clone
virtual
autoPtr
<
coordinateModification
>
clone
(
const
plane
Translation
&
pt
const
plane
Scaling
&
pt
)
const
{
return
autoPtr
<
coordinateModification
>
(
new
plane
Translation
new
plane
Scaling
(
pt
.
name
(),
pt
.
origin_
,
pt
.
normal_
,
pt
.
translation
Distance_
,
pt
.
scaling
Distance_
,
pt
.
scalingFactor_
)
);
...
...
@@ -147,7 +148,7 @@ public:
// IOstream Operators
Ostream
&
operator
<<
(
Ostream
&
)
const
;
friend
Ostream
&
operator
<<
(
Ostream
&
,
const
plane
Translation
&
);
friend
Ostream
&
operator
<<
(
Ostream
&
,
const
plane
Scaling
&
);
};
...
...
tutorials/cartesianMesh/ship5415Octree/system/meshDict
View file @
d791e0d0
...
...
@@ -54,7 +54,7 @@ anisotropicSources
type plane;
normal (0 0 1);
origin (0 0 250);
translation
Distance 125;
scaling
Distance 125;
scalingFactor 0.5;
}
...
...
@@ -63,7 +63,7 @@ anisotropicSources
type plane;
normal (0 0 -1);
origin (0 0 250);
translation
Distance 125;
scaling
Distance 125;
scalingFactor 0.5;
}
*/
...
...
tutorials/cartesianMesh/singleOrifice/system/meshDict
View file @
d791e0d0
...
...
@@ -32,7 +32,7 @@ anisotropicSources
type plane;
origin (0 0 -20);
normal (0 0 1);
translation
Distance 45;
scaling
Distance 45;
scalingFactor 2;
}
}
...
...
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