Commit 140536cd authored by graham's avatar graham
Browse files
parents be8c67a2 7507b5f6
......@@ -140,7 +140,6 @@ int main(int argc, char *argv[])
case topoSetSource::NEW:
case topoSetSource::ADD:
case topoSetSource::DELETE:
case topoSetSource::SUBSET:
{
Info<< " Applying source " << word(dict.lookup("source"))
<< endl;
......@@ -148,7 +147,7 @@ int main(int argc, char *argv[])
(
dict.lookup("source"),
mesh,
dict.subDict("sourceDict")
dict.subDict("sourceInfo")
);
source().applyToSet(action, currentSet());
......@@ -158,6 +157,40 @@ int main(int argc, char *argv[])
}
break;
case topoSetSource::SUBSET:
{
Info<< " Applying source " << word(dict.lookup("source"))
<< endl;
autoPtr<topoSetSource> source = topoSetSource::New
(
dict.lookup("source"),
mesh,
dict.subDict("sourceInfo")
);
// 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.
currentSet().sync(mesh);
currentSet().write();
}
break;
case topoSetSource::CLEAR:
Info<< " Clearing set" << endl;
currentSet().clear();
......
......@@ -301,31 +301,61 @@ FoamFile
actions
(
// Example:pick up internal faces on outside of cellSet
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Load initial cellSet
{
name c0;
type cellSet;
action new;
source labelToCell;
sourceDict
sourceInfo
{
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;
action invert;
}
// Keep in f0 all faces in c1
{
name c0;
type cellSet;
action delete;
source labelToCell;
sourceDict
name f0;
type faceSet;
action subset;
source cellToFace;
sourceInfo
{
value (1 2 3);
set c1;
option all;
}
}
);
......
......@@ -23,7 +23,7 @@ actions
action new;
source sphereToCell;
sourceDict
sourceInfo
{
centre ( 0.125 0.375 0.05 );
radius 0.005;
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.004 -0.001 -1) (0.012 0.001 1);
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.35 0.35 0.44) (0.65 0.65 0.56);
}
......
......@@ -23,7 +23,7 @@ actions
type cellSet;
action new;
source zoneToCell;
sourceDict
sourceInfo
{
name rotor;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
}
......
......@@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment