Andrea,

I deal with this in my applications by providing a template  
specialization for the print() operator like so:

template<>
inline
void Parameters::Parameter<std::vector<Real> >::print (std::ostream&  
os) const
{
   for (unsigned int i=0; i<_value.size(); i++)
     os << _value[i] << " ";
}


Substitute std::vector<Real> for whatever your type is.  I just have  
this in a header file that my main.C pulls in.  I think it could also  
work if you just put it right in main.C... but I'm not sure.

Derek

On Mar 18, 2009, at 1:40 PM, Andrea Hawkins wrote:

> Hello Again!
>
> So, to efficiently deal with the boundary nodes, I figured I would  
> just
> create an equation_system parameter which could hold these values  
> and could
> then be easily passed to my residual and jacobian functions. I'm  
> using the
> following code to add the parameter:
>
> std::vector<unsigned int> b_nodes;
>
>  // Create vector to hold boundary dofs
>  equation_systems.parameters.set<std::vector<unsigned int> >
> ("boundary_nodes") = b_nodes;
>
> When I try to compile it, however, I'm getting the error listed at  
> the end
> of this email. I am wondering if this is just because parameters of  
> type
> std::vector<unsigned int> are not allowed. Or if the definition of  
> "<<" just
> doesn't deal with it.
>
> Thanks in advance for all your help!
> Andrea
>
>
> /h1/ahawkins/LIBRARIES/LIBMESH/libmesh-r3191/include/utils/ 
> parameters.h(255):
> error: no operator "<<" matches these operands
>            operand types are: std::ostream << const  
> std::vector<unsigned
> int, std::allocator<unsigned int>>
>    os << _value;
>       ^
>          detected during:
>            instantiation of "void
> Parameters::Parameter<T>::print(std::ostream &) const [with
> T=std::vector<unsigned int, std::allocator<unsigned int>>]" at line  
> 365
>            implicit generation of  
> "Parameters::Parameter<T>::~Parameter()
> [with T=std::vector<unsigned int, std::allocator<unsigned int>>]" at  
> line
> 365
>            instantiation of class "Parameters::Parameter<T> [with
> T=std::vector<unsigned int, std::allocator<unsigned int>>]" at line  
> 365
>            instantiation of "bool Parameters::have_parameter<T>(const
> std::string &) const [with T=std::vector<unsigned int,
> std::allocator<unsigned int>>]" at line 405
>            instantiation of "T &Parameters::set<T>(const std::string  
> &)
> [with T=std::vector<unsigned int, std::allocator<unsigned int>>]" at  
> line
> 319 of "tgm_init.C"
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)  
> are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly  
> and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based  
> development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to