Commit 624579e3 authored by Marcus Mohr's avatar Marcus Mohr
Browse files

Merge branch 'mohr/BlockFunctionMethods' into 'master'

Adds copyBoundaryConditionFromFunction() method to BlockFunction

See merge request !451
parents ab4ed4c0 3abdaebe
Pipeline #34644 failed with stages
in 243 minutes and 39 seconds
......@@ -280,6 +280,16 @@ class BlockFunction
}
}
template < typename OtherType >
void copyBoundaryConditionFromFunction( const BlockFunction< OtherType >& other )
{
WALBERLA_ASSERT_EQUAL( subFunc_.size(), other.getNumberOfBlocks() );
for ( uint_t k = 0; k < subFunc_.size(); k++ )
{
subFunc_[k]->setBoundaryCondition( other.getSubFunction( k ).getBoundaryCondition() );
}
}
protected:
const std::string functionName_;
std::vector< std::shared_ptr< GenericFunction< value_t > > > subFunc_;
......
......@@ -552,16 +552,6 @@ class P1CahnHilliardFunction : public BlockFunction< value_t >
{
return this->getSubFunction( 1 ).template unwrap< P1Function< value_t > >();
}
// TODO: Move this into BlockFunction
template < typename OtherFunctionValueType >
void copyBoundaryConditionFromFunction( const P1CahnHilliardFunction< OtherFunctionValueType >& other )
{
for ( uint_t k = 0; k < BlockFunction< value_t >::getNumberOfBlocks(); ++k )
{
BlockFunction< value_t >::getSubFunction( k ).setBoundaryCondition( other.getSubFunction( k ).getBoundaryCondition() );
}
}
};
/// [CahnHilliardFunction definition]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment