本文整理汇总了C++中lduMatrix::asymmetric方法的典型用法代码示例。如果您正苦于以下问题:C++ lduMatrix::asymmetric方法的具体用法?C++ lduMatrix::asymmetric怎么用?C++ lduMatrix::asymmetric使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lduMatrix
的用法示例。
在下文中一共展示了lduMatrix::asymmetric方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: name
Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
(
const word& fieldName,
const lduMatrix& matrix,
const FieldField<Field, scalar>& interfaceBouCoeffs,
const FieldField<Field, scalar>& interfaceIntCoeffs,
const lduInterfaceFieldPtrsList& interfaces,
const dictionary& solverControls
)
{
const word name(solverControls.lookup("solver"));
if (matrix.diagonal())
{
return autoPtr<lduMatrix::solver>
(
new diagonalSolver
(
fieldName,
matrix,
interfaceBouCoeffs,
interfaceIntCoeffs,
interfaces,
solverControls
)
);
}
else if (matrix.symmetric())
{
symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(name);
if (constructorIter == symMatrixConstructorTablePtr_->end())
{
FatalIOErrorIn
(
"lduMatrix::solver::New", solverControls
) << "Unknown symmetric matrix solver " << name << nl << nl
<< "Valid symmetric matrix solvers are :" << endl
<< symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<lduMatrix::solver>
(
constructorIter()
(
fieldName,
matrix,
interfaceBouCoeffs,
interfaceIntCoeffs,
interfaces,
solverControls
)
);
}
else if (matrix.asymmetric())
{
asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(name);
if (constructorIter == asymMatrixConstructorTablePtr_->end())
{
FatalIOErrorIn
(
"lduMatrix::solver::New", solverControls
) << "Unknown asymmetric matrix solver " << name << nl << nl
<< "Valid asymmetric matrix solvers are :" << endl
<< asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<lduMatrix::solver>
(
constructorIter()
(
fieldName,
matrix,
interfaceBouCoeffs,
interfaceIntCoeffs,
interfaces,
solverControls
)
);
}
else
{
FatalIOErrorIn
(
"lduMatrix::solver::New", solverControls
) << "cannot solve incomplete matrix, "
"no diagonal or off-diagonal coefficient"
<< exit(FatalIOError);
return autoPtr<lduMatrix::solver>(NULL);
}
}
示例2: if
void Foam::lduMatrix::operator-=(const lduMatrix& A)
{
if (A.diagPtr_)
{
diag() -= A.diag();
}
if (symmetric() && A.symmetric())
{
upper() -= A.upper();
}
else if (symmetric() && A.asymmetric())
{
if (upperPtr_)
{
lower();
}
else
{
upper();
}
upper() -= A.upper();
lower() -= A.lower();
}
else if (asymmetric() && A.symmetric())
{
if (A.upperPtr_)
{
lower() -= A.upper();
upper() -= A.upper();
}
else
{
lower() -= A.lower();
upper() -= A.lower();
}
}
else if (asymmetric() && A.asymmetric())
{
lower() -= A.lower();
upper() -= A.upper();
}
else if (diagonal())
{
if (A.upperPtr_)
{
upper() = -A.upper();
}
if (A.lowerPtr_)
{
lower() = -A.lower();
}
}
else if (A.diagonal())
{
}
else
{
FatalErrorIn("lduMatrix::operator-=(const lduMatrix& A)")
<< "Unknown matrix type combination"
<< abort(FatalError);
}
}
示例3: if
void Foam::lduMatrix::operator-=(const lduMatrix& A)
{
if (A.diagPtr_)
{
diag() -= A.diag();
}
if (symmetric() && A.symmetric())
{
upper() -= A.upper();
}
else if (symmetric() && A.asymmetric())
{
if (upperPtr_)
{
lower();
}
else
{
upper();
}
upper() -= A.upper();
lower() -= A.lower();
}
else if (asymmetric() && A.symmetric())
{
if (A.upperPtr_)
{
lower() -= A.upper();
upper() -= A.upper();
}
else
{
lower() -= A.lower();
upper() -= A.lower();
}
}
else if (asymmetric() && A.asymmetric())
{
lower() -= A.lower();
upper() -= A.upper();
}
else if (diagonal())
{
if (A.upperPtr_)
{
upper() = -A.upper();
}
if (A.lowerPtr_)
{
lower() = -A.lower();
}
}
else if (A.diagonal())
{
}
else
{
if (debug > 1)
{
WarningIn("lduMatrix::operator-=(const lduMatrix& A)")
<< "Unknown matrix type combination" << nl
<< " this :"
<< " diagonal:" << diagonal()
<< " symmetric:" << symmetric()
<< " asymmetric:" << asymmetric() << nl
<< " A :"
<< " diagonal:" << A.diagonal()
<< " symmetric:" << A.symmetric()
<< " asymmetric:" << A.asymmetric()
<< endl;
}
}
}
示例4: if
Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
(
const word& fieldName,
const lduMatrix& matrix,
const FieldField<Field, scalar>& interfaceBouCoeffs,
const FieldField<Field, scalar>& interfaceIntCoeffs,
const lduInterfaceFieldPtrsList& interfaces,
const dictionary& solverControls
)
{
word name;
// Handle primitive or dictionary entry
const entry& e =
solverControls.lookupEntry("smoother", keyType::LITERAL);
if (e.isDict())
{
e.dict().readEntry("smoother", name);
}
else
{
e.stream() >> name;
}
// not (yet?) needed:
// const dictionary& controls = e.isDict() ? e.dict() : dictionary::null;
if (matrix.symmetric())
{
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown symmetric matrix smoother "
<< name << nl << nl
<< "Valid symmetric matrix smoothers are :" << endl
<< symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<lduMatrix::smoother>
(
cstrIter()
(
fieldName,
matrix,
interfaceBouCoeffs,
interfaceIntCoeffs,
interfaces
)
);
}
else if (matrix.asymmetric())
{
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown asymmetric matrix smoother "
<< name << nl << nl
<< "Valid asymmetric matrix smoothers are :" << endl
<< asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<lduMatrix::smoother>
(
cstrIter()
(
fieldName,
matrix,
interfaceBouCoeffs,
interfaceIntCoeffs,
interfaces
)
);
}
FatalIOErrorInFunction(solverControls)
<< "cannot solve incomplete matrix, "
"no diagonal or off-diagonal coefficient"
<< exit(FatalIOError);
return nullptr;
}