BUG: fixed subset action in topoSet; renamed sourceDict keyword to sourceInfo.

This commit is contained in:
mattijs 2010-05-11 12:09:49 +01:00
parent 9f2e06ed55
commit 7507b5f6bd
18 changed files with 89 additions and 26 deletions

View File

@ -140,6 +140,23 @@ int main(int argc, char *argv[])
case topoSetSource::NEW:
case topoSetSource::ADD:
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:
{
Info<< " Applying source " << word(dict.lookup("source"))
@ -148,10 +165,26 @@ int main(int argc, char *argv[])
(
dict.lookup("source"),
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.
currentSet().sync(mesh);
currentSet().write();

View File

@ -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;
}
}
);

View File

@ -23,7 +23,7 @@ actions
action new;
source sphereToCell;
sourceDict
sourceInfo
{
centre ( 0.125 0.375 0.05 );
radius 0.005;

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.004 -0.001 -1) (0.012 0.001 1);
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
}

View File

@ -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);
}

View File

@ -23,7 +23,7 @@ actions
type cellSet;
action new;
source zoneToCell;
sourceDict
sourceInfo
{
name rotor;
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
}

View File

@ -22,7 +22,7 @@ actions
type cellSet;
action new;
source boxToCell;
sourceDict
sourceInfo
{
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
}