|
[Sponsors] |
operator for creating squared components of a tensor |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 8, 2014, 09:45 |
operator for creating squared components of a tensor
|
#1 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
Hi!
I need a simple operator which works on a tensor and calculates another tensor with squared components (a_{ij} -> (a_{ij})^2). Is there already an operator, which does that in OF? I've tried an outer product (gradU*gradU): Code:
tmp<volTensorField> S2(const tmp<volTensorField>& gradU) const { return (gradU * gradU); } Code:
error: no match for ‘operator*’ in ‘gradU * gradU’ Code:
error: no matching function for call to ‘sqr(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >&)’ Blaz |
|
December 10, 2014, 11:24 |
|
#2 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
I may not be clear enough. I need to create a new volTensorField, which tensor's elements are squared tensor elements of gradU field (gradU is also a volTensorField typedef):
PHP Code:
So, my idea is to define a new operation among volTensorField objects, which would directly produce required new volTensorField. Is this easy to implement or not? What do you suggest? Thanks! Blaz |
|
January 10, 2019, 07:56 |
|
#3 | |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
Quote:
|
||
January 13, 2019, 23:09 |
|
#4 |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12 |
cmptMultiply(gradU,gradU)?
__________________
https://openfoam.top |
|
Tags |
component, operator, square, tensor |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Stress tensor components | ap | FLUENT | 1 | August 15, 2023 04:41 |
tensor components | LM4112 | OpenFOAM Post-Processing | 0 | June 17, 2013 12:02 |
Accessing the components of the resolved Reynolds stress tensor in a LES | flotus1 | FLUENT | 8 | January 21, 2013 04:34 |
Problems compiling with the 'diag' tensor function (diagonal components matrix) | danihuso | OpenFOAM Programming & Development | 12 | January 31, 2012 11:45 |
Strain-rate tensor components | vkrastev | OpenFOAM | 2 | March 2, 2010 03:39 |