Merge branch 'master' into develop

This commit is contained in:
Andrew Heather
2017-04-25 12:31:22 +01:00
8 changed files with 40 additions and 11 deletions

View File

@ -62,7 +62,7 @@ Foam::tmp<Foam::Field<Type>> filterFarPoints
) )
{ {
tmp<Field<Type>> tNewField(new Field<Type>(field.size())); tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
Field<Type>& newField = tNewField(); Field<Type>& newField = tNewField.ref();
label added = 0; label added = 0;
label count = 0; label count = 0;
@ -160,7 +160,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
( (
new triadField(mesh.vertexCount(), triad::unset) new triadField(mesh.vertexCount(), triad::unset)
); );
triadField& alignments = tAlignments(); triadField& alignments = tAlignments.ref();
for for
( (
@ -188,7 +188,7 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
( (
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT)) new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
); );
pointField& points = tPoints(); pointField& points = tPoints.ref();
for for
( (

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "DelaunayMesh.H" #include "DelaunayMesh.H"
#include "polyMesh.H"
#include "labelPair.H" #include "labelPair.H"
#include "PrintTable.H" #include "PrintTable.H"
#include "pointIOField.H" #include "pointIOField.H"

View File

@ -35,7 +35,7 @@ Foam::tmp<Foam::Field<Type>> Foam::smoothAlignmentSolver::filterFarPoints
) )
{ {
tmp<Field<Type>> tNewField(new Field<Type>(field.size())); tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
Field<Type>& newField = tNewField(); Field<Type>& newField = tNewField.ref();
label added = 0; label added = 0;
label count = 0; label count = 0;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -92,8 +92,9 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
if (Pstream::master() && writeToFile_) if (Pstream::master() && writeToFile_)
{ {
const scalar timeNow = fileObr_.time().timeOutputValue(); const scalar startTime = fileObr_.time().startTime().value();
const word startTimeName = Time::timeName(timeNow); const scalar userStartTime = fileObr_.time().timeToUserTime(startTime);
const word startTimeName = Time::timeName(userStartTime);
fileName outputDir(baseFileDir()/prefix_/startTimeName); fileName outputDir(baseFileDir()/prefix_/startTimeName);

View File

@ -416,7 +416,8 @@ void Foam::timeVaryingMappedFixedValueFvPatchField<Type>::checkTable()
// Reread values and interpolate // Reread values and interpolate
fileName valsFile fileName valsFile
( (
this->db().time().caseConstant() this->db().time().path()
/this->db().time().caseConstant()
/"boundaryData" /"boundaryData"
/this->patch().name() /this->patch().name()
/sampleTimes_[endSampleTime_].name() /sampleTimes_[endSampleTime_].name()

View File

@ -131,6 +131,21 @@ void Foam::functionObjects::runTimePostPro::scene::readColours
} }
void Foam::functionObjects::runTimePostPro::scene::setActorVisibility
(
vtkRenderer* renderer,
const bool visible
) const
{
vtkActorCollection *actors = renderer->GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i)
{
vtkActor *actor = vtkActor::SafeDownCast(actors->GetItemAsObject(i));
actor->SetVisibility(visible);
}
}
void Foam::functionObjects::runTimePostPro::scene::initialise void Foam::functionObjects::runTimePostPro::scene::initialise
( (
vtkRenderer* renderer, vtkRenderer* renderer,
@ -239,9 +254,13 @@ void Foam::functionObjects::runTimePostPro::scene::setCamera
// to be done once on initialisation // to be done once on initialisation
if (!clipBox_.empty()) if (!clipBox_.empty())
{ {
// Call ResetCamera() to fit clip box in view setActorVisibility(renderer, false);
clipBoxActor_->VisibilityOn(); clipBoxActor_->VisibilityOn();
// Call ResetCamera() to fit clip box in view
renderer->ResetCamera(); renderer->ResetCamera();
setActorVisibility(renderer, true);
clipBoxActor_->VisibilityOff(); clipBoxActor_->VisibilityOff();
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -105,6 +105,13 @@ class scene
//- Read colour properties //- Read colour properties
void readColours(const dictionary& dict); void readColours(const dictionary& dict);
//- Set visibility of all actors on/off
void setActorVisibility
(
vtkRenderer* renderer,
const bool visible
) const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
scene(const scene&); scene(const scene&);

View File

@ -32,7 +32,7 @@ boundaryField
type waveTransmissive; type waveTransmissive;
field p; field p;
psi thermo:psi; psi thermo:psi;
gamma 1.3; gamma 1.4;
fieldInf $pressure; fieldInf $pressure;
lInf 1; lInf 1;
value $internalField; value $internalField;