Chi-Tech
chi_math::spatial_discretization::FiniteVolume Class Reference

#include <FiniteVolume.h>

Inheritance diagram for chi_math::spatial_discretization::FiniteVolume:
chi_math::SpatialDiscretization

Public Member Functions

virtual ~FiniteVolume ()=default
 
void CreateCellMappings ()
 
void BuildSparsityPattern (std::vector< int64_t > &nodal_nnz_in_diag, std::vector< int64_t > &nodal_nnz_off_diag, const UnknownManager &unknown_manager) const override
 
int64_t MapDOF (const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const override
 
int64_t MapDOFLocal (const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const override
 
int64_t MapDOF (const chi_mesh::Cell &cell, unsigned int node) const override
 
int64_t MapDOFLocal (const chi_mesh::Cell &cell, unsigned int node) const override
 
size_t GetNumGhostDOFs (const UnknownManager &unknown_manager) const override
 
std::vector< int64_t > GetGhostDOFIndices (const UnknownManager &unknown_manager) const override
 
- Public Member Functions inherited from chi_math::SpatialDiscretization
std::pair< std::set< uint32_t >, std::set< uint32_t > > MakeCellInternalAndBndryNodeIDs (const chi_mesh::Cell &cell) const
 
const CellMappingGetCellMapping (const chi_mesh::Cell &cell) const
 
SpatialDiscretizationType Type () const
 
const chi_mesh::MeshContinuumGrid () const
 
CoordinateSystemType GetCoordinateSystemType () const
 
virtual void BuildSparsityPattern (std::vector< int64_t > &nodal_nnz_in_diag, std::vector< int64_t > &nodal_nnz_off_diag, const UnknownManager &unknown_manager) const =0
 
virtual int64_t MapDOF (const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const =0
 
virtual int64_t MapDOFLocal (const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const =0
 
virtual int64_t MapDOF (const chi_mesh::Cell &cell, unsigned int node) const =0
 
virtual int64_t MapDOFLocal (const chi_mesh::Cell &cell, unsigned int node) const =0
 
size_t GetNumLocalDOFs (const UnknownManager &unknown_manager) const
 
size_t GetNumGlobalDOFs (const UnknownManager &unknown_manager) const
 
virtual size_t GetNumGhostDOFs (const UnknownManager &unknown_manager) const =0
 
virtual std::vector< int64_t > GetGhostDOFIndices (const UnknownManager &unknown_manager) const =0
 
size_t GetNumLocalAndGhostDOFs (const UnknownManager &unknown_manager) const
 
size_t GetCellNumNodes (const chi_mesh::Cell &cell) const
 
const std::vector< chi_mesh::Vector3 > & GetCellNodeLocations (const chi_mesh::Cell &cell) const
 
std::vector< std::vector< std::vector< int > > > MakeInternalFaceNodeMappings (double tolerance=1.0e-12) const
 For each local cell, for each face, for each face-node, provides a mapping to the adjacent cell's nodes. More...
 
void CopyVectorWithUnknownScope (const std::vector< double > &from_vector, std::vector< double > &to_vector, const UnknownManager &from_vec_uk_structure, unsigned int from_vec_uk_id, const UnknownManager &to_vec_uk_structure, unsigned int to_vec_uk_id) const
 
virtual void LocalizePETScVector (Vec petsc_vector, std::vector< double > &local_vector, const UnknownManager &unknown_manager) const
 
virtual void LocalizePETScVectorWithGhosts (Vec petsc_vector, std::vector< double > &local_vector, const UnknownManager &unknown_manager) const
 
SpatialWeightFunction GetSpatialWeightingFunction () const
 
virtual ~SpatialDiscretization ()=default
 

Static Public Member Functions

static std::shared_ptr< FiniteVolumeNew (const chi_mesh::MeshContinuum &in_grid, CoordinateSystemType in_cs_type=CoordinateSystemType::CARTESIAN)
 
- Static Public Member Functions inherited from chi_math::SpatialDiscretization
static double CartesianSpatialWeightFunction (const chi_mesh::Vector3 &point)
 
static double CylindricalRZSpatialWeightFunction (const chi_mesh::Vector3 &point)
 
static double Spherical1DSpatialWeightFunction (const chi_mesh::Vector3 &point)
 

Protected Member Functions

void OrderNodes ()
 
- Protected Member Functions inherited from chi_math::SpatialDiscretization
 SpatialDiscretization (const chi_mesh::MeshContinuum &grid, CoordinateSystemType cs_type, SDMType sdm_type)
 

Private Member Functions

 FiniteVolume (const chi_mesh::MeshContinuum &grid, CoordinateSystemType cs_type)
 

Private Attributes

std::map< uint64_t, uint64_t > neighbor_cell_local_ids_
 

Additional Inherited Members

- Public Types inherited from chi_math::SpatialDiscretization
typedef std::function< double(const chi_mesh::Vector3 &)> SpatialWeightFunction
 
- Data Fields inherited from chi_math::SpatialDiscretization
const UnknownManager UNITARY_UNKNOWN_MANAGER
 
- Protected Types inherited from chi_math::SpatialDiscretization
typedef SpatialDiscretizationType SDMType
 
- Protected Attributes inherited from chi_math::SpatialDiscretization
const chi_mesh::MeshContinuumref_grid_
 
std::vector< std::unique_ptr< CellMapping > > cell_mappings_
 
std::map< uint64_t, std::shared_ptr< CellMapping > > nb_cell_mappings_
 
uint64_t local_block_address_ = 0
 
std::vector< uint64_t > locJ_block_address_
 
std::vector< uint64_t > locJ_block_size_
 
uint64_t local_base_block_size_ = 0
 
uint64_t globl_base_block_size_ = 0
 
const CoordinateSystemType coord_sys_type_
 

Detailed Description

Spatial discretizations supporting Finite Volume representations.

Definition at line 14 of file FiniteVolume.h.

Constructor & Destructor Documentation

◆ FiniteVolume()

chi_math::spatial_discretization::FiniteVolume::FiniteVolume ( const chi_mesh::MeshContinuum grid,
chi_math::CoordinateSystemType  cs_type 
)
explicitprivate

Only constructor for this method.

Definition at line 11 of file fv_00_constrdestr.cc.

◆ ~FiniteVolume()

virtual chi_math::spatial_discretization::FiniteVolume::~FiniteVolume ( )
virtualdefault

Member Function Documentation

◆ BuildSparsityPattern()

void chi_math::spatial_discretization::FiniteVolume::BuildSparsityPattern ( std::vector< int64_t > &  nodal_nnz_in_diag,
std::vector< int64_t > &  nodal_nnz_off_diag,
const UnknownManager unknown_manager 
) const
overridevirtual

Builds finite volume based sparsity pattern.

Implements chi_math::SpatialDiscretization.

Definition at line 11 of file fv_03_buildsparsity.cc.

◆ CreateCellMappings()

void chi_math::spatial_discretization::FiniteVolume::CreateCellMappings ( )

Definition at line 9 of file fv_01b_createcellmappings.cc.

◆ GetGhostDOFIndices()

std::vector< int64_t > chi_math::spatial_discretization::FiniteVolume::GetGhostDOFIndices ( const UnknownManager unknown_manager) const
overridevirtual

Returns the ghost DOF indices.

Implements chi_math::SpatialDiscretization.

Definition at line 25 of file fv_05_utils.cc.

◆ GetNumGhostDOFs()

size_t chi_math::spatial_discretization::FiniteVolume::GetNumGhostDOFs ( const UnknownManager unknown_manager) const
overridevirtual

Get the number of ghost degrees-of-freedom.

Implements chi_math::SpatialDiscretization.

Definition at line 14 of file fv_05_utils.cc.

◆ MapDOF() [1/2]

int64_t chi_math::spatial_discretization::FiniteVolume::MapDOF ( const chi_mesh::Cell cell,
unsigned int  node 
) const
inlineoverridevirtual

Maps the local address of a degree of freedom. This can include ghost entries if the specific discretization has any. Default structure here is a single scalar unknown.

Implements chi_math::SpatialDiscretization.

Definition at line 57 of file FiniteVolume.h.

◆ MapDOF() [2/2]

int64_t chi_math::spatial_discretization::FiniteVolume::MapDOF ( const chi_mesh::Cell cell,
unsigned int  node,
const UnknownManager unknown_manager,
unsigned int  unknown_id,
unsigned int  component 
) const
overridevirtual

Maps a finite volume degree of freedom using an unknown manager.

Implements chi_math::SpatialDiscretization.

Definition at line 16 of file fv_04a_mappings.cc.

◆ MapDOFLocal() [1/2]

int64_t chi_math::spatial_discretization::FiniteVolume::MapDOFLocal ( const chi_mesh::Cell cell,
unsigned int  node 
) const
inlineoverridevirtual

Maps the local address of a degree of freedom. This can include ghost entries if the specific discretization has any. Default structure here is a single scalar unknown.

Implements chi_math::SpatialDiscretization.

Definition at line 61 of file FiniteVolume.h.

◆ MapDOFLocal() [2/2]

int64_t chi_math::spatial_discretization::FiniteVolume::MapDOFLocal ( const chi_mesh::Cell cell,
unsigned int  node,
const UnknownManager unknown_manager,
unsigned int  unknown_id,
unsigned int  component 
) const
overridevirtual

Maps a finite volume degree of freedom to a local address using an unknown manager.

Implements chi_math::SpatialDiscretization.

Definition at line 63 of file fv_04a_mappings.cc.

◆ New()

std::shared_ptr< FiniteVolume > chi_math::spatial_discretization::FiniteVolume::New ( const chi_mesh::MeshContinuum in_grid,
chi_math::CoordinateSystemType  in_cs_type = CoordinateSystemType::CARTESIAN 
)
static

Publicly accessible construction handler.

Definition at line 23 of file fv_00_constrdestr.cc.

◆ OrderNodes()

void chi_math::spatial_discretization::FiniteVolume::OrderNodes ( )
protected

Develops node ordering per location.

Definition at line 19 of file fv_02_ordering.cc.

Field Documentation

◆ neighbor_cell_local_ids_

std::map<uint64_t, uint64_t> chi_math::spatial_discretization::FiniteVolume::neighbor_cell_local_ids_
private

Definition at line 17 of file FiniteVolume.h.


The documentation for this class was generated from the following files: