/* This file is part of the OpenLB library
*
* Copyright (C) 2012, 2014 Lukas Baron, Tim Dornieden, Mathias J. Krause,
* Albert Mink
* E-mail contact: info@openlb.net
* The most recent release of OpenLB can be downloaded at
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SUPER_LATTICE_LOCAL_F_3D_HH
#define SUPER_LATTICE_LOCAL_F_3D_HH
#include // for generic i/o
#include // for lpnorm
#include "superBaseF3D.h"
#include "superLatticeLocalF3D.h"
#include "functors/analytical/indicator/indicatorBaseF3D.h"
#include "indicator/superIndicatorF3D.h"
#include "dynamics/lbHelpers.h" // for computation of lattice rho and velocity
#include "geometry/superGeometry3D.h"
namespace olb {
template
SuperLatticeFpop3D::SuperLatticeFpop3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, DESCRIPTOR::q)
{
this->getName() = "fPop";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeFpop3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeFpop3D::operator()( T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeDissipation3D::SuperLatticeDissipation3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticeF3D(sLattice, 1), _converter(converter)
{
this->getName() = "dissipation";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeDissipation3D(this->_sLattice.getBlockLattice(iC),this->_converter));
}
}
template
bool SuperLatticeDissipation3D::operator()( T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysDissipation3D::SuperLatticePhysDissipation3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 1)
{
this->getName() = "physDissipation";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysDissipation3D(
this->_sLattice.getExtendedBlockLattice(iC),
this->_sLattice.getOverlap(),
this->_converter)
);
}
}
template
bool SuperLatticePhysDissipation3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeEffevtiveDissipation3D::SuperLatticeEffevtiveDissipation3D(
SuperLattice3D& sLattice, const UnitConverter& converter, T smagoConst, LESDynamics& LESdynamics)
: SuperLatticeF3D(sLattice, 1), _converter(converter)
{
this->getName() = "EffevtiveDissipation";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeEffevtiveDissipation3D(this->_sLattice.getBlockLattice(iC),
this->_converter, smagoConst, LESdynamics));
}
}
template
bool SuperLatticeEffevtiveDissipation3D::operator()( T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysEffevtiveDissipation3D::SuperLatticePhysEffevtiveDissipation3D(
SuperLattice3D& sLattice, const UnitConverter& converter, T smagoConst, LESDynamics& LESdynamics)
: SuperLatticePhysF3D(sLattice, converter, 1)
{
this->getName() = "physEffevtiveDissipation";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticePhysEffevtiveDissipation3D(this->_sLattice.getBlockLattice(iC),
this->_converter, smagoConst, LESdynamics));
}
}
template
bool SuperLatticePhysEffevtiveDissipation3D::operator()(T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeDensity3D::SuperLatticeDensity3D(
SuperLattice3D& sLattice) : SuperLatticeF3D(sLattice, 1)
{
this->getName() = "density";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeDensity3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeDensity3D::operator()( T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeVelocity3D::SuperLatticeVelocity3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, 3)
{
this->getName() = "velocity";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeVelocity3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeVelocity3D::operator()( T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeExternalVelocity3D::SuperLatticeExternalVelocity3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, 3)
{
this->getName() = "externalVelocity";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeExternalVelocity3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeExternalVelocity3D::operator()( T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeFlux3D::SuperLatticeFlux3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, 3)
{
this->getName() = "flux";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeFlux3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeFlux3D::operator()( T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeStrainRate3D::SuperLatticeStrainRate3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticeF3D(sLattice, 9), _converter(converter)
{
this->getName() = "strainRate";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeStrainRate3D(this->_sLattice.getBlockLattice(iC),this->_converter));
}
}
template
bool SuperLatticeStrainRate3D::operator()(T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysStrainRate3D::SuperLatticePhysStrainRate3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 9)
{
this->getName() = "physStrainRate";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysStrainRate3D(
this->_sLattice.getExtendedBlockLattice(iC),
this->_sLattice.getOverlap(),
this->_converter)
);
}
}
template
bool SuperLatticePhysStrainRate3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeGeometry3D::SuperLatticeGeometry3D(
SuperLattice3D& sLattice, SuperGeometry3D& superGeometry,
const int material)
: SuperLatticeF3D(sLattice, 1), _superGeometry(superGeometry),
_material(material)
{
this->getName() = "geometry";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeGeometry3D(
this->_sLattice.getBlockLattice(iC),
this->_superGeometry.getBlockGeometry(iC),
_material) );
}
}
template
bool SuperLatticeGeometry3D::operator()( T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeRank3D::SuperLatticeRank3D(
SuperLattice3D& sLattice) : SuperLatticeF3D(sLattice, 1)
{
this->getName() = "rank";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back( new BlockLatticeRank3D(this->_sLattice.getBlockLattice(iC)) );
}
}
template
bool SuperLatticeRank3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
this->getBlockF( this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
return true;
} else {
return false;
}
}
template
SuperLatticeCuboid3D::SuperLatticeCuboid3D(
SuperLattice3D& sLattice) : SuperLatticeF3D(sLattice, 1)
{
this->getName() = "cuboid";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back( new BlockLatticeCuboid3D(this->_sLattice.getBlockLattice(iC),
this->_sLattice.getLoadBalancer().glob(iC)) );
}
}
template
bool SuperLatticeCuboid3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
this->getBlockF( this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
return true;
} else {
return false;
}
}
template
SuperLatticePhysPressure3D::SuperLatticePhysPressure3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 1)
{
this->getName() = "physPressure";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysPressure3D(
this->_sLattice.getExtendedBlockLattice(iC),
this->_sLattice.getOverlap(),
this->_converter)
);
}
}
template
bool SuperLatticePhysPressure3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysVelocity3D::SuperLatticePhysVelocity3D(
SuperLattice3D& sLattice, const UnitConverter& converter, bool print)
: SuperLatticePhysF3D(sLattice, converter, 3), _print(print)
{
this->getName() = "physVelocity";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysVelocity3D(
this->_sLattice.getExtendedBlockLattice(iC),
this->_sLattice.getOverlap(),
this->_converter,
_print)
);
}
}
template
bool SuperLatticePhysVelocity3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysExternal3D::SuperLatticePhysExternal3D(
SuperLattice3D& sLattice, T convFactorToPhysUnits,
int offset, int size)
: SuperLatticeF3D(sLattice, 3)
{
this->getName() = "physExtField";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysExternal3D(
this->_sLattice.getBlockLattice(iC), convFactorToPhysUnits,
offset, size)
);
}
}
template
bool SuperLatticePhysExternal3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysExternalPorosity3D::SuperLatticePhysExternalPorosity3D
(SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice,converter,1)
{
this->getName() = "ExtPorosityField";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysExternalPorosity3D(
this->_sLattice.getExtendedBlockLattice(iC),
this->_sLattice.getOverlap(),
this->_converter)
);
}
}
template
bool SuperLatticePhysExternalPorosity3D::operator()(
T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysExternalVelocity3D::SuperLatticePhysExternalVelocity3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 3)
{
this->getName() = "physVelExtField";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysExternalVelocity3D(
this->_sLattice.getBlockLattice(iC), this->_converter)
);
}
}
template
bool SuperLatticePhysExternalVelocity3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
const int loc = this->_sLattice.getLoadBalancer().loc(input[0]);
return this->getBlockF(loc)(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePhysExternalParticleVelocity3D::SuperLatticePhysExternalParticleVelocity3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 2)
{
this->getName() = "ExtPartVelField";
for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
this->_blockF.emplace_back(
new BlockLatticePhysExternalParticleVelocity3D(
sLattice.getExtendedBlockLattice(iC),
converter)
);
}
}
template
bool SuperLatticePhysExternalParticleVelocity3D::operator()(
T output[], const int input[])
{
auto& load = this->_sLattice.getLoadBalancer();
const int& globIC = input[0];
if (load.rank(globIC) == singleton::mpi().getRank()) {
const int overlap = this->_sLattice.getOverlap();
int inputLocal[3] = { };
inputLocal[0] = input[1] + overlap;
inputLocal[1] = input[2] + overlap;
inputLocal[2] = input[3] + overlap;
return this->getBlockF(load.loc(globIC))(output, inputLocal);
} else {
return false;
}
}
template
SuperLatticePhysBoundaryForce3D::SuperLatticePhysBoundaryForce3D(
SuperLattice3D& sLattice,
FunctorPtr>&& indicatorF,
const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 3),
_indicatorF(std::move(indicatorF))
{
this->getName() = "physBoundaryForce";
for (int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); ++iC) {
this->_blockF.emplace_back(
new BlockLatticePhysBoundaryForce3D(
this->_sLattice.getBlockLattice(iC),
_indicatorF->getBlockIndicatorF(iC),
this->_converter));
}
}
template
SuperLatticePhysBoundaryForce3D::SuperLatticePhysBoundaryForce3D(
SuperLattice3D& sLattice,
SuperGeometry3D& superGeometry, const int material,
const UnitConverter& converter)
: SuperLatticePhysBoundaryForce3D(sLattice,
superGeometry.getMaterialIndicator(material),
converter)
{ }
template
bool SuperLatticePhysBoundaryForce3D::operator() (T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]))(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePSMPhysForce3D::SuperLatticePSMPhysForce3D(
SuperLattice3D& sLattice,
const UnitConverter& converter,
int mode_)
: SuperLatticePhysF3D(sLattice, converter, 3)
{
this->getName() = "PSMPhysForce";
for (int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); ++iC) {
this->_blockF.emplace_back(
new BlockLatticePSMPhysForce3D(
this->_sLattice.getBlockLattice(iC),
this->_converter, mode_));
}
}
template
bool SuperLatticePSMPhysForce3D::operator() (T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]))(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePhysWallShearStress3D::SuperLatticePhysWallShearStress3D(
SuperLattice3D& sLattice, SuperGeometry3D& superGeometry,
const int material, const UnitConverter& converter,
IndicatorF3D& indicator)
: SuperLatticePhysF3D(sLattice, converter, 1),
_superGeometry(superGeometry), _material(material)
{
this->getName() = "physWallShearStress";
const int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(
new BlockLatticePhysWallShearStress3D(
this->_sLattice.getExtendedBlockLattice(iC),
_superGeometry.getExtendedBlockGeometry(iC),
this->_sLattice.getOverlap(),
_material,
this->_converter,
indicator)
);
}
}
template
bool SuperLatticePhysWallShearStress3D::operator() (T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]))(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePhysCorrBoundaryForce3D::SuperLatticePhysCorrBoundaryForce3D(
SuperLattice3D& sLattice,
FunctorPtr>&& indicatorF,
const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 3),
_indicatorF(std::move(indicatorF))
{
this->getName() = "physCorrBoundaryForce";
for (int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); ++iC) {
this->_blockF.emplace_back(
new BlockLatticePhysCorrBoundaryForce3D(
this->_sLattice.getBlockLattice(iC),
_indicatorF->getBlockIndicatorF(iC),
this->_converter));
}
}
template
SuperLatticePhysCorrBoundaryForce3D::SuperLatticePhysCorrBoundaryForce3D(
SuperLattice3D& sLattice,
SuperGeometry3D& superGeometry, const int material,
const UnitConverter& converter)
: SuperLatticePhysCorrBoundaryForce3D(sLattice,
superGeometry.getMaterialIndicator(material),
converter)
{ }
template
bool SuperLatticePhysCorrBoundaryForce3D::operator()(T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]))(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeField3D::SuperLatticeField3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, DESCRIPTOR::template size())
{
this->getName() = "externalField";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; ++iC) {
this->_blockF.emplace_back(
new BlockLatticeField3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticeField3D::operator()(
T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().isLocal(input[0])) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]))(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePorosity3D::SuperLatticePorosity3D(
SuperLattice3D& sLattice)
: SuperLatticeF3D(sLattice, 1)
{
this->getName() = "porosity";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticePorosity3D(this->_sLattice.getBlockLattice(iC)));
}
}
template
bool SuperLatticePorosity3D::operator()(
T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticeVolumeFractionApproximation3D::SuperLatticeVolumeFractionApproximation3D(
SuperLattice3D& sLattice, SuperGeometry3D& superGeometry,
IndicatorF3D& indicator, int refinementLevel,
const UnitConverter& converter, bool insideOut)
: SuperLatticeF3D(sLattice, 1)
{
this->getName() = "volumeFractionApproximation";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back(new BlockLatticeVolumeFractionApproximation3D(this->_sLattice.getBlockLattice(iC),
superGeometry.getBlockGeometry(iC),
indicator, refinementLevel,
converter, insideOut));
}
}
template
bool SuperLatticeVolumeFractionApproximation3D::operator()(
T output[], const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF(this->_sLattice.getLoadBalancer().loc(input[0]) )(output,&input[1]);
} else {
return false;
}
}
template
SuperLatticePhysPermeability3D::SuperLatticePhysPermeability3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 1)
{
this->getName() = "permeability";
int maxC = this->_sLattice.getLoadBalancer().size();
this->_blockF.reserve(maxC);
for (int iC = 0; iC < maxC; iC++) {
this->_blockF.emplace_back( new BlockLatticePhysPermeability3D(
this->_sLattice.getBlockLattice(iC), this->getConverter() ) );
}
}
template
bool SuperLatticePhysPermeability3D::operator()(T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF( this->_sLattice.getLoadBalancer().loc(input[0]) )(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePhysCroppedPermeability3D::SuperLatticePhysCroppedPermeability3D(
SuperLattice3D& sLattice, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 1)
{
this->getName() = "cropped_permeability";
for (int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); iC++ ) {
this->_blockF.emplace_back( new BlockLatticePhysCroppedPermeability3D(
this->_sLattice.getBlockLattice(iC), this->getConverter() ) );
}
}
template
bool SuperLatticePhysCroppedPermeability3D::operator()(T output[],
const int input[])
{
if (this->_sLattice.getLoadBalancer().rank(input[0]) == singleton::mpi().getRank()) {
return this->getBlockF( this->_sLattice.getLoadBalancer().loc(input[0]) )(output, &input[1]);
} else {
return false;
}
}
template
SuperLatticePhysDarcyForce3D::SuperLatticePhysDarcyForce3D(
SuperLattice3D& sLattice, SuperGeometry3D& superGeometry,
const int material, const UnitConverter& converter)
: SuperLatticePhysF3D(sLattice, converter, 3),
_superGeometry(superGeometry), _material(material)
{
this->getName() = "alphaU";
}
template
bool SuperLatticePhysDarcyForce3D::operator()(T output[], const int input[])
{
SuperLatticePhysPermeability3D permeability(this->_sLattice, this->_converter);
SuperLatticeVelocity3D velocity(this->_sLattice);
T nu = this->_converter.getPhysViscosity();
T K;
T u[velocity.getTargetDim()];
permeability(&K,input);
velocity(u,input);
output[0] = -nu / K * u[0];
output[1] = -nu / K * u[1];
output[2] = -nu / K * u[2];
return true;
}
template
SuperEuklidNorm3D