Skip to content

Commit

Permalink
Remove unnecessary constructors in SpectroscopicAbsorption QoI
Browse files Browse the repository at this point in the history
  • Loading branch information
tradowsk committed Aug 8, 2018
1 parent 5bb9cac commit 4c20d03
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
6 changes: 0 additions & 6 deletions src/qoi/include/grins/integrated_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ namespace GRINS
*/
IntegratedFunction(unsigned int p_level, std::shared_ptr<Function> f, RayfireMesh * rayfire, const std::string & qoi_name);

//! Constructor
/*!
Used by the QoIFactory. Passes GetPot through to RayfireMesh for construction
*/
IntegratedFunction(const GetPot & input, unsigned int p_level, std::shared_ptr<Function> f, const std::string & input_qoi_string, const std::string & qoi_name);

//! Copy Constructor
/*!
Required to deep-copy the UniquePtr RayfireMesh object
Expand Down
5 changes: 2 additions & 3 deletions src/qoi/include/grins/spectroscopic_absorption.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ namespace GRINS
@param output_as_csv Flag for whether we should output QoI value in wavenumber,absorption CSV format
or in the normal QoIBase way
*/
SpectroscopicAbsorption(const GetPot & input, const std::string & qoi_name,
std::shared_ptr<FEMFunctionAndDerivativeBase<libMesh::Real> > absorb,
bool output_as_csv);
SpectroscopicAbsorption(std::shared_ptr<FEMFunctionAndDerivativeBase<libMesh::Real> > absorb,
RayfireMesh * rayfire, const std::string & qoi_name, bool output_as_csv);

virtual QoIBase * clone() const;

Expand Down
9 changes: 0 additions & 9 deletions src/qoi/src/integrated_function.C
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ namespace GRINS
_rayfire(rayfire)
{}

template<typename Function>
IntegratedFunction<Function>::IntegratedFunction(const GetPot & input, unsigned int p_level, std::shared_ptr<Function> f, const std::string & input_qoi_string, const std::string & qoi_name) :
QoIBase(qoi_name),
_p_level(p_level),
_f(f)
{
_rayfire.reset(new RayfireMesh(input,input_qoi_string));
}

template<typename Function>
IntegratedFunction<Function>::IntegratedFunction(const IntegratedFunction & original) :
QoIBase(original),
Expand Down
10 changes: 7 additions & 3 deletions src/qoi/src/qoi_factory.C
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ namespace GRINS
std::shared_ptr<libMesh::FunctionBase<libMesh::Real> >
f( new libMesh::ParsedFunction<libMesh::Real>(function) );

qoi = new IntegratedFunction<libMesh::FunctionBase<libMesh::Real> >(input,p_level,f,"IntegratedFunction",integrated_function);
RayfireMesh * rayfire = new RayfireMesh(input,"IntegratedFunction");

qoi = new IntegratedFunction<libMesh::FunctionBase<libMesh::Real> >(p_level,f,rayfire,qoi_name);
}

else if ( qoi_name == spectroscopic_absorption )
Expand Down Expand Up @@ -195,6 +197,8 @@ namespace GRINS
libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI");
#endif

RayfireMesh * rayfire = new RayfireMesh(input,"SpectroscopicAbsorption");

// This is the wavenumber of the "laser" or a range of wavenumbers to scan over
std::string desired_wavenumber_var = "QoI/SpectroscopicAbsorption/desired_wavenumber";
unsigned int num_wavenumbers = input.vector_variable_size(desired_wavenumber_var);
Expand All @@ -216,7 +220,7 @@ namespace GRINS
libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI");
#endif

qoi = new SpectroscopicAbsorption(input,qoi_name,absorb,output_as_csv);
qoi = new SpectroscopicAbsorption(absorb,rayfire,qoi_name,output_as_csv);
}
else if (num_wavenumbers == 3)
{
Expand Down Expand Up @@ -255,7 +259,7 @@ namespace GRINS
libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI");
#endif

qoi = new SpectroscopicAbsorption(input,qoi_name,absorb,output_as_csv);
qoi = new SpectroscopicAbsorption(absorb,rayfire,qoi_name,output_as_csv);
qois->add_qoi( *qoi );
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/qoi/src/spectroscopic_absorption.C
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@

namespace GRINS
{
SpectroscopicAbsorption::SpectroscopicAbsorption( const GetPot & input, const std::string & qoi_name,
std::shared_ptr<FEMFunctionAndDerivativeBase<libMesh::Real> > absorb,
bool output_as_csv)
: IntegratedFunction<FEMFunctionAndDerivativeBase<libMesh::Real> >(input,2 /* QGauss order */,absorb,"SpectroscopicAbsorption",qoi_name),
SpectroscopicAbsorption::SpectroscopicAbsorption( std::shared_ptr<FEMFunctionAndDerivativeBase<libMesh::Real> > absorb,
RayfireMesh * rayfire, const std::string & qoi_name, bool output_as_csv)
: IntegratedFunction<FEMFunctionAndDerivativeBase<libMesh::Real> >(2 /* QGauss order */,absorb,rayfire,qoi_name),
_output_as_csv(output_as_csv)
{}

Expand Down

0 comments on commit 4c20d03

Please sign in to comment.