mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: fixed subset action in topoSet; renamed sourceDict keyword to sourceInfo.
This commit is contained in:
@ -140,6 +140,23 @@ int main(int argc, char *argv[])
|
|||||||
case topoSetSource::NEW:
|
case topoSetSource::NEW:
|
||||||
case topoSetSource::ADD:
|
case topoSetSource::ADD:
|
||||||
case topoSetSource::DELETE:
|
case topoSetSource::DELETE:
|
||||||
|
{
|
||||||
|
Info<< " Applying source " << word(dict.lookup("source"))
|
||||||
|
<< endl;
|
||||||
|
autoPtr<topoSetSource> source = topoSetSource::New
|
||||||
|
(
|
||||||
|
dict.lookup("source"),
|
||||||
|
mesh,
|
||||||
|
dict.subDict("sourceInfo")
|
||||||
|
);
|
||||||
|
|
||||||
|
source().applyToSet(action, currentSet());
|
||||||
|
// Synchronize for coupled patches.
|
||||||
|
currentSet().sync(mesh);
|
||||||
|
currentSet().write();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case topoSetSource::SUBSET:
|
case topoSetSource::SUBSET:
|
||||||
{
|
{
|
||||||
Info<< " Applying source " << word(dict.lookup("source"))
|
Info<< " Applying source " << word(dict.lookup("source"))
|
||||||
@ -148,10 +165,26 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
dict.lookup("source"),
|
dict.lookup("source"),
|
||||||
mesh,
|
mesh,
|
||||||
dict.subDict("sourceDict")
|
dict.subDict("sourceInfo")
|
||||||
);
|
);
|
||||||
|
|
||||||
source().applyToSet(action, currentSet());
|
// Backup current set.
|
||||||
|
autoPtr<topoSet> oldSet
|
||||||
|
(
|
||||||
|
topoSet::New
|
||||||
|
(
|
||||||
|
setType,
|
||||||
|
mesh,
|
||||||
|
currentSet().name() + "_old2",
|
||||||
|
currentSet()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
currentSet().clear();
|
||||||
|
source().applyToSet(topoSetSource::NEW, currentSet());
|
||||||
|
|
||||||
|
// Combine new value of currentSet with old one.
|
||||||
|
currentSet().subset(oldSet());
|
||||||
// Synchronize for coupled patches.
|
// Synchronize for coupled patches.
|
||||||
currentSet().sync(mesh);
|
currentSet().sync(mesh);
|
||||||
currentSet().write();
|
currentSet().write();
|
||||||
|
|||||||
@ -301,31 +301,61 @@ FoamFile
|
|||||||
|
|
||||||
actions
|
actions
|
||||||
(
|
(
|
||||||
|
// Example:pick up internal faces on outside of cellSet
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Load initial cellSet
|
||||||
{
|
{
|
||||||
name c0;
|
name c0;
|
||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source labelToCell;
|
source labelToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
value (12 13 56);
|
value (12 13 56);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get all faces in cellSet
|
||||||
{
|
{
|
||||||
name c0;
|
name f0;
|
||||||
|
type faceSet;
|
||||||
|
action new;
|
||||||
|
source cellToFace;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set c0;
|
||||||
|
option all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine inverse cellSet
|
||||||
|
{
|
||||||
|
name c1;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set c0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name c1;
|
||||||
type cellSet;
|
type cellSet;
|
||||||
action invert;
|
action invert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep in f0 all faces in c1
|
||||||
{
|
{
|
||||||
name c0;
|
name f0;
|
||||||
type cellSet;
|
type faceSet;
|
||||||
action delete;
|
action subset;
|
||||||
source labelToCell;
|
source cellToFace;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
value (1 2 3);
|
set c1;
|
||||||
|
option all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ actions
|
|||||||
action new;
|
action new;
|
||||||
|
|
||||||
source sphereToCell;
|
source sphereToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
centre ( 0.125 0.375 0.05 );
|
centre ( 0.125 0.375 0.05 );
|
||||||
radius 0.005;
|
radius 0.005;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.004 -0.001 -1) (0.012 0.001 1);
|
box (0.004 -0.001 -1) (0.012 0.001 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
|
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
|
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
|
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
|
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
|
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
|
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.35 0.35 0.44) (0.65 0.65 0.56);
|
box (0.35 0.35 0.44) (0.65 0.65 0.56);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source zoneToCell;
|
source zoneToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
name rotor;
|
name rotor;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user