Memosa-FVM
0.2
|
#include <LinearSystem.h>
Public Member Functions | |
LinearSystem () | |
virtual | ~LinearSystem () |
void | initAssembly () |
void | initSolve () |
void | postSolve () |
void | updateSolution () |
shared_ptr< LinearSystem > | createCoarse (const int groupSize, const double weightRatioThreshold) |
MultiField & | getX () |
MultiField & | getB () |
MultiField & | getDelta () |
MultiField & | getResidual () |
MultiFieldMatrix & | getMatrix () |
MultiField & | getCoarseIndex () |
shared_ptr< MultiField > | getDeltaPtr () |
shared_ptr< MultiField > | getBPtr () |
void | replaceDelta (shared_ptr< MultiField > newDelta) |
void | replaceB (shared_ptr< MultiField > newB) |
void | replaceResidual (shared_ptr< MultiField > newR) |
void | setCoarseningField (const Field &f) |
Public Attributes | |
bool | isSymmetric |
Private Attributes | |
MultiFieldMatrix | _matrix |
shared_ptr< MultiField > | _x |
shared_ptr< MultiField > | _b |
shared_ptr< MultiField > | _delta |
shared_ptr< MultiField > | _residual |
MultiField | _coarseIndex |
const Field * | _coarseningField |
shared_ptr< MultiField > | _xAux |
shared_ptr< MultiField > | _bAux |
shared_ptr< MultiField > | _deltaAux |
shared_ptr< MultiField > | _residualAux |
Friends | |
class | LinearSystemMerger |
Definition at line 11 of file LinearSystem.h.
LinearSystem::LinearSystem | ( | ) |
Definition at line 13 of file LinearSystem.cpp.
Referenced by createCoarse().
|
virtual |
Definition at line 23 of file LinearSystem.cpp.
shared_ptr< LinearSystem > LinearSystem::createCoarse | ( | const int | groupSize, |
const double | weightRatioThreshold | ||
) |
we create only one entry in coarseIndex for each StorageSite even if the site is present in multiple fine ArrayIndices of x. If a coarseningField is specified we will use that otherwise the first one gets used
coarsen the matrices corresponding to the fieldIndices we have selected and then sync ghost cell values. This process will fill up the coarseSizes and coarseGhostSizes variables in the matrix as well create the mappers
now we have the coarse indices, sizes, sites, mappers and * connectivities computed for the fieldIndices we * selected. Before we can create coarse matrices we need to * set these for the other fieldIndices since the matrices of * course need to be created for all the fine matrices * present
Definition at line 67 of file LinearSystem.cpp.
References _b, MultiFieldMatrix::_coarseGatherMaps, MultiFieldMatrix::_coarseGhostSizes, _coarseIndex, MultiFieldMatrix::_coarseMatrices, _coarseningField, MultiFieldMatrix::_coarseScatterMaps, MultiFieldMatrix::_coarseSites, MultiFieldMatrix::_coarseSizes, MultiFieldMatrix::_coarseToFineMappings, _matrix, MultiField::addArray(), MultiFieldMatrix::createCoarseConnectivity(), MultiFieldMatrix::createCoarseMatrices(), MultiFieldMatrix::createCoarsening(), MultiFieldMatrix::createCoarseToFineMapping(), MultiField::getArrayPtr(), StorageSite::getCount(), StorageSite::getGatherMap(), StorageSite::getGatherProcID(), ArrayBase::getLength(), StorageSite::getScatterMap(), StorageSite::getScatterProcID(), StorageSite::getTag(), MultiFieldMatrix::hasMatrix(), LinearSystem(), MultiField::sync(), MultiFieldMatrix::syncGhostCoarsening(), and MultiField::zero().
Referenced by AMG::createCoarseLevels().
|
inline |
Definition at line 33 of file LinearSystem.h.
References _b.
Referenced by StructureModel< T >::Impl::advanceExplicit(), StructureModel< T >::Impl::applyBC(), AMG::cycle(), LinearizeInterfaceJumpUnconnected< X, Diag, OffDiag >::discretize(), ILU0Solver::doSweeps(), JacobiSolver::doSweeps(), SpikeSolver::doSweeps(), AMG::doSweeps(), ThermalModel< T >::Impl::dumpMatrix(), VacancyModel< T >::Impl::dumpMatrix(), PlateModel< T >::Impl::dumpMatrix(), ThermalModel< T >::Impl::linearize(), FractureModel< T >::Impl::linearize(), VacancyModel< T >::Impl::linearize(), SpeciesModel< T >::Impl::linearize(), ElectricModel< T >::Impl::linearizeChargeTransport(), FlowModel< T >::Impl::linearizeContinuity(), PlateModel< T >::Impl::linearizeDeformation(), StructureModel< T >::Impl::linearizeDeformation(), KeModel< T >::Impl::linearizedissipation(), ElectricModel< T >::Impl::linearizeElectroStatics(), KeModel< T >::Impl::linearizeenergy(), KineticModel< T >::linearizeKineticModel(), FlowModel< T >::Impl::linearizeMomentum(), BatteryModel< T >::Impl::linearizePC(), BatteryModel< T >::Impl::linearizePC_Thermal(), PhononModel< T >::linearizePhononModel(), BatteryModel< T >::Impl::linearizePotential(), BatteryModel< T >::Impl::linearizeSpecies(), BatteryModel< T >::Impl::linearizeThermal(), BatteryModel< T >::Impl::printMatrixElementsOnFace(), ILU0Solver::solve(), JacobiSolver::solve(), BCGStab::solve(), CG::solve(), SpikeSolver::solve(), DirectSolver::solve(), and AMG::solve().
|
inline |
Definition at line 42 of file LinearSystem.h.
References _b.
Referenced by BCGStab::solve(), and CG::solve().
|
inline |
|
inline |
Definition at line 34 of file LinearSystem.h.
References _delta.
Referenced by StructureModel< T >::Impl::advanceExplicit(), AMG::cycle(), ILU0Solver::doSweeps(), JacobiSolver::doSweeps(), SpikeSolver::doSweeps(), AMG::doSweeps(), FlowModel< T >::Impl::postContinuitySolve(), PlateModel< T >::Impl::postPlateSolve(), BCGStab::solve(), ILU0Solver::solve(), JacobiSolver::solve(), CG::solve(), SpikeSolver::solve(), DirectSolver::solve(), and AMG::solve().
|
inline |
Definition at line 41 of file LinearSystem.h.
References _delta.
Referenced by BCGStab::solve(), and CG::solve().
|
inline |
Definition at line 37 of file LinearSystem.h.
References _matrix.
Referenced by StructureModel< T >::Impl::advanceExplicit(), StructureModel< T >::Impl::applyBC(), AMG::createCoarseLevels(), AMG::cycle(), LinearizeInterfaceJumpUnconnected< X, Diag, OffDiag >::discretize(), JacobiSolver::doSweeps(), ILU0Solver::doSweeps(), SpikeSolver::doSweeps(), AMG::doSweeps(), ThermalModel< T >::Impl::dumpMatrix(), VacancyModel< T >::Impl::dumpMatrix(), PlateModel< T >::Impl::dumpMatrix(), ElectricModel< T >::Impl::initChargeTransportLinearization(), FlowModel< T >::Impl::initContinuityLinearization(), PlateModel< T >::Impl::initDeformationLinearization(), StructureModel< T >::Impl::initDeformationLinearization(), ElectricModel< T >::Impl::initElectroStaticsLinearization(), KineticModel< T >::initKineticModelLinearization(), ThermalModel< T >::Impl::initLinearization(), FractureModel< T >::Impl::initLinearization(), VacancyModel< T >::Impl::initLinearization(), SpeciesModel< T >::Impl::initLinearization(), KeModel< T >::Impl::initLinearization(), KeModel< T >::Impl::initLinearizationk(), FlowModel< T >::Impl::initMomentumLinearization(), BatteryModel< T >::Impl::initPCLinearization(), PhononModel< T >::initPhononModelLinearization(), BatteryModel< T >::Impl::initPotentialLinearization(), BatteryModel< T >::Impl::initSpeciesLinearization(), BatteryModel< T >::Impl::initThermalLinearization(), ThermalModel< T >::Impl::linearize(), FractureModel< T >::Impl::linearize(), VacancyModel< T >::Impl::linearize(), SpeciesModel< T >::Impl::linearize(), ElectricModel< T >::Impl::linearizeChargeTransport(), FlowModel< T >::Impl::linearizeContinuity(), PlateModel< T >::Impl::linearizeDeformation(), StructureModel< T >::Impl::linearizeDeformation(), KeModel< T >::Impl::linearizedissipation(), ElectricModel< T >::Impl::linearizeElectroStatics(), KeModel< T >::Impl::linearizeenergy(), KineticModel< T >::linearizeKineticModel(), FlowModel< T >::Impl::linearizeMomentum(), BatteryModel< T >::Impl::linearizePC(), BatteryModel< T >::Impl::linearizePC_Thermal(), PhononModel< T >::linearizePhononModel(), BatteryModel< T >::Impl::linearizePotential(), BatteryModel< T >::Impl::linearizeSpecies(), BatteryModel< T >::Impl::linearizeThermal(), FlowModel< T >::Impl::postContinuitySolve(), BatteryModel< T >::Impl::printMatrixElementsOnFace(), JacobiSolver::solve(), ILU0Solver::solve(), CG::solve(), BCGStab::solve(), SpikeSolver::solve(), DirectSolver::solve(), AMG::solve(), and FlowModel< T >::Impl::solveMomentum().
|
inline |
Definition at line 35 of file LinearSystem.h.
References _residual.
Referenced by AMG::cycle(), JacobiSolver::doSweeps(), ILU0Solver::doSweeps(), SpikeSolver::doSweeps(), AMG::doSweeps(), BCGStab::solve(), ILU0Solver::solve(), JacobiSolver::solve(), CG::solve(), SpikeSolver::solve(), DirectSolver::solve(), and AMG::solve().
|
inline |
Definition at line 32 of file LinearSystem.h.
References _x.
Referenced by StructureModel< T >::Impl::advanceExplicit(), StructureModel< T >::Impl::applyBC(), LinearizeInterfaceJumpUnconnected< X, Diag, OffDiag >::discretize(), ElectricModel< T >::Impl::initChargeTransportLinearization(), FlowModel< T >::Impl::initContinuityLinearization(), PlateModel< T >::Impl::initDeformationLinearization(), StructureModel< T >::Impl::initDeformationLinearization(), ElectricModel< T >::Impl::initElectroStaticsLinearization(), KineticModel< T >::initKineticModelLinearization(), ThermalModel< T >::Impl::initLinearization(), FractureModel< T >::Impl::initLinearization(), VacancyModel< T >::Impl::initLinearization(), SpeciesModel< T >::Impl::initLinearization(), KeModel< T >::Impl::initLinearization(), KeModel< T >::Impl::initLinearizationk(), FlowModel< T >::Impl::initMomentumLinearization(), BatteryModel< T >::Impl::initPCLinearization(), PhononModel< T >::initPhononModelLinearization(), BatteryModel< T >::Impl::initPotentialLinearization(), BatteryModel< T >::Impl::initSpeciesLinearization(), BatteryModel< T >::Impl::initThermalLinearization(), ThermalModel< T >::Impl::linearize(), FractureModel< T >::Impl::linearize(), VacancyModel< T >::Impl::linearize(), SpeciesModel< T >::Impl::linearize(), ElectricModel< T >::Impl::linearizeChargeTransport(), FlowModel< T >::Impl::linearizeContinuity(), PlateModel< T >::Impl::linearizeDeformation(), StructureModel< T >::Impl::linearizeDeformation(), KeModel< T >::Impl::linearizedissipation(), ElectricModel< T >::Impl::linearizeElectroStatics(), KeModel< T >::Impl::linearizeenergy(), KineticModel< T >::linearizeKineticModel(), FlowModel< T >::Impl::linearizeMomentum(), BatteryModel< T >::Impl::linearizePC(), BatteryModel< T >::Impl::linearizePC_Thermal(), PhononModel< T >::linearizePhononModel(), BatteryModel< T >::Impl::linearizePotential(), BatteryModel< T >::Impl::linearizeSpecies(), BatteryModel< T >::Impl::linearizeThermal(), and BatteryModel< T >::Impl::printMatrixElementsOnFace().
void LinearSystem::initAssembly | ( | ) |
Definition at line 32 of file LinearSystem.cpp.
References _b, _matrix, _x, and MultiFieldMatrix::initAssembly().
Referenced by FractureModel< T >::Impl::advance(), ThermalModel< T >::Impl::advance(), VacancyModel< T >::Impl::advance(), PhononModel< T >::advance(), SpeciesModel< T >::Impl::advance(), KeModel< T >::Impl::advance(), KineticModel< T >::advance(), BatteryModel< T >::Impl::advanceCoupled(), BatteryModel< T >::Impl::advancePotential(), BatteryModel< T >::Impl::advanceSpecies(), BatteryModel< T >::Impl::advanceThermal(), ThermalModel< T >::Impl::dumpMatrix(), VacancyModel< T >::Impl::dumpMatrix(), PlateModel< T >::Impl::dumpMatrix(), ElectricModel< T >::Impl::solveChargeTransport(), PlateModel< T >::Impl::solveDeformation(), StructureModel< T >::Impl::solveDeformation(), ElectricModel< T >::Impl::solveElectroStatics(), and FlowModel< T >::Impl::solveMomentum().
void LinearSystem::initSolve | ( | ) |
Definition at line 40 of file LinearSystem.cpp.
References _b, _bAux, _delta, _deltaAux, _matrix, _residual, _residualAux, _x, _xAux, Matrix::eliminateBoundaryEquations(), MultiFieldMatrix::getMatrix(), MultiFieldMatrix::hasMatrix(), and Matrix::isInvertible().
Referenced by FractureModel< T >::Impl::advance(), ThermalModel< T >::Impl::advance(), VacancyModel< T >::Impl::advance(), PhononModel< T >::advance(), SpeciesModel< T >::Impl::advance(), KeModel< T >::Impl::advance(), KineticModel< T >::advance(), BatteryModel< T >::Impl::advanceCoupled(), BatteryModel< T >::Impl::advancePotential(), BatteryModel< T >::Impl::advanceSpecies(), BatteryModel< T >::Impl::advanceThermal(), ThermalModel< T >::Impl::dumpMatrix(), VacancyModel< T >::Impl::dumpMatrix(), PlateModel< T >::Impl::dumpMatrix(), ElectricModel< T >::Impl::solveChargeTransport(), PlateModel< T >::Impl::solveDeformation(), StructureModel< T >::Impl::solveDeformation(), ElectricModel< T >::Impl::solveElectroStatics(), and FlowModel< T >::Impl::solveMomentum().
void LinearSystem::postSolve | ( | ) |
Definition at line 250 of file LinearSystem.cpp.
References _b, _bAux, _delta, _deltaAux, _matrix, _residual, _residualAux, _x, _xAux, and MultiFieldMatrix::solveBoundary().
Referenced by FractureModel< T >::Impl::advance(), ThermalModel< T >::Impl::advance(), VacancyModel< T >::Impl::advance(), PhononModel< T >::advance(), SpeciesModel< T >::Impl::advance(), KeModel< T >::Impl::advance(), KineticModel< T >::advance(), BatteryModel< T >::Impl::advanceCoupled(), StructureModel< T >::Impl::advanceExplicit(), BatteryModel< T >::Impl::advancePotential(), BatteryModel< T >::Impl::advanceSpecies(), BatteryModel< T >::Impl::advanceThermal(), ElectricModel< T >::Impl::solveChargeTransport(), PlateModel< T >::Impl::solveDeformation(), StructureModel< T >::Impl::solveDeformation(), ElectricModel< T >::Impl::solveElectroStatics(), and FlowModel< T >::Impl::solveMomentum().
|
inline |
Definition at line 45 of file LinearSystem.h.
References _b.
Referenced by BCGStab::solve(), and CG::solve().
|
inline |
Definition at line 44 of file LinearSystem.h.
References _delta.
Referenced by BCGStab::solve(), and CG::solve().
|
inline |
|
inline |
void LinearSystem::updateSolution | ( | ) |
Definition at line 265 of file LinearSystem.cpp.
Referenced by FractureModel< T >::Impl::advance(), ThermalModel< T >::Impl::advance(), VacancyModel< T >::Impl::advance(), PhononModel< T >::advance(), SpeciesModel< T >::Impl::advance(), KeModel< T >::Impl::advance(), KineticModel< T >::advance(), BatteryModel< T >::Impl::advanceCoupled(), StructureModel< T >::Impl::advanceExplicit(), BatteryModel< T >::Impl::advancePotential(), BatteryModel< T >::Impl::advanceSpecies(), BatteryModel< T >::Impl::advanceThermal(), ElectricModel< T >::Impl::solveChargeTransport(), PlateModel< T >::Impl::solveDeformation(), StructureModel< T >::Impl::solveDeformation(), ElectricModel< T >::Impl::solveElectroStatics(), and FlowModel< T >::Impl::solveMomentum().
|
friend |
Definition at line 15 of file LinearSystem.h.
|
private |
Definition at line 55 of file LinearSystem.h.
Referenced by createCoarse(), getB(), getBPtr(), initAssembly(), initSolve(), postSolve(), and replaceB().
|
private |
Definition at line 61 of file LinearSystem.h.
Referenced by initSolve(), and postSolve().
|
private |
Definition at line 58 of file LinearSystem.h.
Referenced by createCoarse(), and getCoarseIndex().
|
private |
Definition at line 59 of file LinearSystem.h.
Referenced by createCoarse(), and setCoarseningField().
|
private |
Definition at line 56 of file LinearSystem.h.
Referenced by getDelta(), getDeltaPtr(), initSolve(), postSolve(), replaceDelta(), and updateSolution().
|
private |
Definition at line 62 of file LinearSystem.h.
Referenced by initSolve(), and postSolve().
|
private |
Definition at line 53 of file LinearSystem.h.
Referenced by createCoarse(), getMatrix(), initAssembly(), initSolve(), and postSolve().
|
private |
Definition at line 57 of file LinearSystem.h.
Referenced by getResidual(), initSolve(), postSolve(), and replaceResidual().
|
private |
Definition at line 63 of file LinearSystem.h.
Referenced by initSolve(), and postSolve().
|
private |
Definition at line 54 of file LinearSystem.h.
Referenced by getX(), initAssembly(), initSolve(), postSolve(), and updateSolution().
|
private |
Definition at line 60 of file LinearSystem.h.
Referenced by initSolve(), and postSolve().
bool LinearSystem::isSymmetric |
Definition at line 50 of file LinearSystem.h.
Referenced by AMG::createCoarseLevels(), and AMG::cycle().