Skip to content
Snippets Groups Projects
Commit b078ccd3 authored by Van Dung NGUYEN's avatar Van Dung NGUYEN
Browse files

add new filter based on intervals for every ip value

parent bdfad920
No related branches found
No related tags found
No related merge requests found
...@@ -103,3 +103,24 @@ double GPFilterActivePlasticZone::getFactor(const IPVariable* ipvcur, const IPVa ...@@ -103,3 +103,24 @@ double GPFilterActivePlasticZone::getFactor(const IPVariable* ipvcur, const IPVa
} }
}; };
GPFilter* GPFilterActivePlasticZone::clone() const {return new GPFilterActivePlasticZone(*this);}; GPFilter* GPFilterActivePlasticZone::clone() const {return new GPFilterActivePlasticZone(*this);};
GPFilterIPValueBounds::GPFilterIPValueBounds(int ipVal, double lowerBound, double upperBound, const std::string name):
GPFilter(), _name(name),_lowerBound(lowerBound), _upperBound(upperBound), _ipVal(ipVal){};
GPFilterIPValueBounds::GPFilterIPValueBounds(const GPFilterIPValueBounds& src)
:GPFilter(src),_name(src._name),_ipVal(src._ipVal), _lowerBound(src._lowerBound), _upperBound(src._upperBound){};
GPFilterIPValueBounds::~GPFilterIPValueBounds(){}
std::string GPFilterIPValueBounds::getName() const {return _name;}
double GPFilterIPValueBounds::getFactor(const IPVariable* ipvcur, const IPVariable* ipvprev) const
{
double p = ipvcur->get(_ipVal);
if ((p >= _lowerBound) and (p <=_upperBound))
{
return 1.;
}
else
{
return 0.;
}
};
GPFilter* GPFilterIPValueBounds::clone() const {return new GPFilterIPValueBounds(*this);};
\ No newline at end of file
...@@ -112,4 +112,22 @@ class GPFilterActivePlasticZone : public GPFilter ...@@ -112,4 +112,22 @@ class GPFilterActivePlasticZone : public GPFilter
#endif #endif
}; };
class GPFilterIPValueBounds : public GPFilter
{
protected:
std::string _name;
int _ipVal;
double _lowerBound, _upperBound;
public:
GPFilterIPValueBounds(int ipVal, double lowerBound, double upperBound,
const std::string name = "GPFilterIPValueBounds");
GPFilterIPValueBounds(const GPFilterIPValueBounds& src);
virtual ~GPFilterIPValueBounds();
#ifndef SWIG
virtual std::string getName() const;
virtual double getFactor(const IPVariable* ipvcur, const IPVariable* ipvprev) const;
virtual GPFilter* clone() const;
#endif
};
#endif //GPFILTER_H_ #endif //GPFILTER_H_
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment