Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
a5f056b1
Commit
a5f056b1
authored
Nov 29, 2010
by
mattijs
Browse files
ENH: Particle.C : allow non-constant transformations
parent
5cccf15b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/basic/Particle/Particle.C
View file @
a5f056b1
...
...
@@ -62,37 +62,29 @@ void Foam::Particle<ParticleType>::correctAfterParallelTransfer
if
(
!
ppp
.
parallel
())
{
if
(
ppp
.
forwardT
().
size
()
==
1
)
{
const
tensor
&
T
=
ppp
.
forwardT
()[
0
];
transformPosition
(
T
);
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
T
);
}
else
{
const
tensor
&
T
=
ppp
.
forwardT
()[
faceI_
];
transformPosition
(
T
);
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
T
);
}
const
tensor
&
T
=
(
ppp
.
forwardT
().
size
()
==
1
?
ppp
.
forwardT
()[
0
]
:
ppp
.
forwardT
()[
faceI_
]
);
transformPosition
(
T
);
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
T
);
}
else
if
(
ppp
.
separated
())
{
if
(
ppp
.
separation
().
size
()
==
1
)
{
position_
-=
ppp
.
separation
()[
0
];
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
-
ppp
.
separation
()[
0
]
);
}
else
{
position_
-=
ppp
.
separation
()[
faceI_
];
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
-
ppp
.
separation
()[
faceI_
]
);
}
const
vector
&
s
=
(
(
ppp
.
separation
().
size
()
==
1
)
?
ppp
.
separation
()[
0
]
:
ppp
.
separation
()[
faceI_
]
);
position_
-=
s
;
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
-
s
);
}
tetFaceI_
=
faceI_
+
ppp
.
start
();
...
...
@@ -773,21 +765,34 @@ void Foam::Particle<ParticleType>::hitCyclicPatch
// See note in correctAfterParallelTransfer for tetPtI_ addressing.
tetPtI_
=
cloud_
.
polyMesh_
.
faces
()[
tetFaceI_
].
size
()
-
1
-
tetPtI_
;
const
cyclicPolyPatch
&
receiveCpp
=
cpp
.
neighbPatch
();
// Now the particle is on the receiving side
if
(
!
c
pp
.
parallel
())
if
(
!
receiveC
pp
.
parallel
())
{
const
tensor
&
T
=
cpp
.
reverseT
()[
0
];
const
tensor
&
T
=
(
receiveCpp
.
forwardT
().
size
()
==
1
?
receiveCpp
.
forwardT
()[
0
]
:
receiveCpp
.
forwardT
()[
receiveCpp
.
whichFace
(
faceI_
)]
);
transformPosition
(
T
);
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
T
);
}
else
if
(
c
pp
.
separated
())
else
if
(
receiveC
pp
.
separated
())
{
position_
+=
cpp
.
separation
()[
0
];
const
vector
&
s
=
(
(
receiveCpp
.
separation
().
size
()
==
1
)
?
receiveCpp
.
separation
()[
0
]
:
receiveCpp
.
separation
()[
receiveCpp
.
whichFace
(
faceI_
)]
);
position_
-=
s
;
static_cast
<
ParticleType
&>
(
*
this
).
transformProperties
(
cpp
.
separation
()[
0
]
-
s
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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