Skip to content
Snippets Groups Projects
Commit d7daad15 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

use adapted data wherever possible, and issue a warning if we do (since only a single time step

is then available to the plugin) -- for Koen
parent 9c12ccd2
No related branches found
No related tags found
No related merge requests found
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......@@ -217,7 +217,7 @@ PView *GMSH_ParticlesPlugin::execute(PView *v)
PView *v1 = getView(iView, v);
if(!v1) return v;
PViewData *data1 = v1->getData();
PViewData *data1 = getPossiblyAdaptiveData(v1);
// sanity checks
if(timeStep > data1->getNumTimeSteps() - 1){
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......@@ -90,6 +90,16 @@ PView *GMSH_PostPlugin::getView(int index, PView *view)
}
}
PViewData *GMSH_PostPlugin::getPossiblyAdaptiveData(PView *view)
{
if(!view) return 0;
if(view->getData()->isAdaptive())
Msg::Warning("Using adapted data from view '%s': only the current time step "
"is available to the plugin", view->getData()->getName().c_str());
return view->getData(true);
}
PViewDataList *GMSH_PostPlugin::getDataList(PView *view, bool showError)
{
if(!view) return 0;
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......@@ -94,6 +94,9 @@ class GMSH_PostPlugin : public GMSH_Plugin
virtual PView *getView(int index, PView *view);
// get the data in list format
virtual PViewDataList *getDataList(PView *view, bool showError=true);
// get the the adapted data (i.e. linear, on refined mesh) if
// available, otherwise get the original data
virtual PViewData *getPossiblyAdaptiveData(PView *view);
virtual void assignSpecificVisibility() const {}
virtual bool geometricalFilter(fullMatrix<double> *) const { return true; }
};
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......@@ -143,7 +143,7 @@ PView *GMSH_SkinPlugin::execute(PView *v)
PView *v1 = getView(iView, v);
if(!v1) return v;
PViewData *data1 = v1->getData(true); // get adaptive data if available
PViewData *data1 = getPossiblyAdaptiveData(v1);
if(data1->hasMultipleMeshes()){
Msg::Error("Skin plugin cannot be applied to multi-mesh views");
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......@@ -208,10 +208,10 @@ PView *GMSH_StreamLinesPlugin::execute(PView *v)
PView *v1 = getView(iView, v);
if(!v1) return v;
PViewData *data1 = v1->getData();
PViewData *data1 = getPossiblyAdaptiveData(v1);
PView *v2 = (otherView < 0) ? 0 : getView(otherView, v);
PViewData *data2 = v2 ? v2->getData() : 0;
PViewData *data2 = v2 ? getPossiblyAdaptiveData(v2) : 0;
// sanity checks
if(timeStep > data1->getNumTimeSteps() - 1){
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment