[Trilinos-Users] Floats in MoochoPack?

Bartlett, Roscoe A rabartl at sandia.gov
Wed Jun 29 13:12:10 MDT 2011


Erin,

The Thyra/MOOCHO interface is only going to work with doubles for the foreseeable future.  MOOCHO is really hard-coded to double (even though it uses typedefs).  It is possible that you could redefine the typdef in MOOCHO to be float but I would be surprised if that did not bring up all kinds of problems.

If you really want to use float under the covers that can be done but it would require some Thyra adapter work but there would be lots of other issues to address as well.  I don't see a major motivation for converting MOOCHO (or NOX,or LOCA, or any other nonlinear Abstract Numerical Algorithm) over to generic floating point types (because they directly store and manipulate so little actual floating point data).

Cheers,

-Ross


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Erin McGarrity
> Sent: Wednesday, June 29, 2011 1:03 PM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] Floats in MoochoPack?
> 
> Hi,
> 
> It seems that the MoochoPack::MoochoThyraSolver and
> MoochoPack::MoochoSolver are specialized to use only double precision
> values. In the example ThyraDiagonalQuadraticResponseOnlyOptMain.cpp
> when I change the ctor templates to floats, i.e.,
> 
> 
> Teuchos::RCP<Thyra::DiagonalQuadraticResponseOnlyModelEvaluator<float>
> >
>       thyraModel =
> Thyra::diagonalQuadraticResponseOnlyModelEvaluator<float> (localDim,
> comm);
> 
>     const RCP<Thyra::VectorBase<float> > ps_vec =
> createMember(thyraModel->get_p_space(0));
>     Thyra::V_S<float>(ps_vec.ptr(), ps);
>     thyraModel->setSolutionVector(ps_vec);
> 
> I get several rcp errors like this:
> 
> /usr/local/Trilinos/MPI/include/Teuchos_RCP.hpp: In constructor
> 'Teuchos::RCP<T>::RCP(const Teuchos::RCP<T2>&) [with T2 =
> Thyra::DiagonalQuadraticResponseOnlyModelEvaluator<float>, T =
> Thyra::ModelEvaluator<double>]':
> /Users/mcgarrit/temp/Moocho/DiagonalQuadraticResponseOnlyOpt/ThyraDiago
> nalQuadraticResponseOnlyOptMain.cpp:107:
>   instantiated from here
> /usr/local/Trilinos/MPI/include/Teuchos_RCP.hpp:202: error: cannot
> convert 'Thyra::DiagonalQuadraticResponseOnlyModelEvaluator<float>*'
> to 'Thyra::ModelEvaluator<double>*' in initialization
> 
> I don't see an easy to get around this without mucking around in the
> library codes. (Note: I have compiled Trilinos 10.6.4 using CMake with
> Thyra floats enabled.) What am I missing here?
> 
> Thanks in advance,
> 
> Erin
> 
> --
> Dr. Erin McGarrity
> Engineering Thermodynamics Section, Process & Energy
> Delft University of Technology
> Leeghwaterstraat 44,  2628CA Delft, The Netherlands
> 
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list