Flow123d
master-8d5574fc2
|
Go to the documentation of this file.
18 #ifndef ASSEMBLY_CONVECTION_HH_
19 #define ASSEMBLY_CONVECTION_HH_
34 template <
unsigned int dim>
41 static constexpr
const char *
name() {
return "MassAssemblyConvection"; }
63 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
70 auto p = *( this->
bulk_points(element_patch_idx).begin() );
82 VecZeroEntries(eq_data_->mass_diag);
83 eq_data_->balance_->start_mass_assembly(eq_data_->subst_idx);
89 eq_data_->balance_->finish_mass_assembly(eq_data_->subst_idx);
91 VecAssemblyBegin(eq_data_->mass_diag);
92 VecAssemblyEnd(eq_data_->mass_diag);
94 eq_data_->is_mass_diag_changed =
true;
98 shared_ptr<FiniteElement<dim>>
fe_;
107 template <
template<
IntDim...>
class DimAssembly>
117 template <
unsigned int dim>
124 static constexpr
const char *
name() {
return "InitCondAssemblyConvection"; }
148 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
151 auto p = *( this->
bulk_points(element_patch_idx).begin() );
159 shared_ptr<FiniteElement<dim>>
fe_;
170 template <
template<
IntDim...>
class DimAssembly>
182 template <
unsigned int dim>
189 static constexpr
const char *
name() {
return "ConcSourcesBdrAssemblyConvection"; }
210 fe_ = std::make_shared< FE_P_disc<dim> >(0);
219 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
230 auto p = *( this->
bulk_points(element_patch_idx).begin() );
242 max_cfl = std::max(max_cfl, fabs(diag));
245 {- eq_fields_->sources_sigma[sbi](p) * elm.measure() * eq_fields_->cross_section(p)},
246 {source * elm.measure()});
255 ASSERT_EQ(cell_side.
dim(), dim).error(
"Dimension of element mismatch!");
281 {local_p0_dof}, {0.0}, flux*
value);
289 {local_p0_dof}, {flux}, 0.0);
325 shared_ptr<FiniteElement<dim>>
fe_;
336 template <
template<
IntDim...>
class DimAssembly>
357 template <
unsigned int dim>
364 static constexpr
const char *
name() {
return "MatrixMpiAssemblyConvection"; }
380 fe_ = std::make_shared< FE_P_disc<dim> >(0);
401 unsigned int sid=0, s1, s2, i_col;
409 auto p = *( this->
edge_points(edge_side).begin() );
418 unsigned int n_edge_sides = edge_side_range.begin()->n_edge_sides();
419 if (n_edge_sides<2)
return;
420 for( s1=0; s1<n_edge_sides; s1++ )
422 for( s2=0, i_col=0; s2<n_edge_sides; s2++ )
424 if (s2==s1)
continue;
438 if (dim == 1)
return;
439 ASSERT_EQ(cell_lower_dim.
dim(), dim-1).error(
"Dimension of element mismatch!");
480 MatAssemblyBegin(
eq_data_->
tm, MAT_FINAL_ASSEMBLY);
481 MatAssemblyEnd(
eq_data_->
tm, MAT_FINAL_ASSEMBLY);
490 shared_ptr<FiniteElement<dim>>
fe_;
511 template <
template<
IntDim...>
class DimAssembly>
FEValues< 3 > fe_values_side_
FEValues of object (of P disc finite element type)
~ConcSourcesBdrAssemblyConvection()
Destructor.
Vec * bcvcorr
Boundary condition correction vector.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
Side side() const
Return Side of given cell and side_idx.
vector< VectorMPI > tm_diag
additions to PETSC transport matrix on the diagonal - from sources (for each substance)
std::vector< double > elm_meassures_
Range< EdgePoint > edge_points(const DHCellSide &cell_side) const
Return EdgePoint range of appropriate dimension.
vector< unsigned int > subst_idx
List of indices used to call balance methods for a set of quantities.
Field< 3, FieldValue< 3 >::Scalar > cross_section
Pointer to DarcyFlow field cross_section.
Quadrature * quad_low_
Quadrature used in assembling methods (dim-1).
void end() override
Implements AssemblyBase::end.
Field< 3, FieldValue< 3 >::VectorFixed > flow_flux
Flow flux, can be result of water flow model.
Field< 3, FieldValue< 3 >::Scalar > water_content
Water content - result of unsaturated water flow model or porosity.
FieldSet used_fields_
Sub field set contains fields used in calculation.
VectorMPI cfl_source_
Parallel vector for source term contribution to CFL condition.
Directing class of FieldValueCache.
unsigned int get_dof_indices(std::vector< LongIdx > &indices) const
Fill vector of the global indices of dofs associated to the cell.
ConvectionTransport::EqFields EqFields
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
bool is_own() const
Return true if accessor represents own element (false for ghost element)
static constexpr bool value
ConvectionTransport::EqData EqData
@ update_values
Shape function values.
vector< VectorMPI > corr_vec
void end() override
Implements AssemblyBase::end.
void initialize(Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
Initialize structures and calculates cell-independent data.
~MatrixMpiAssemblyConvection()
Destructor.
@ update_quadrature_points
Transformed quadrature points.
double side_flux(SidePoint &side_p, FEValues< 3 > &fe_side_values)
Calculate flux on given side point.
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
void end() override
Implements AssemblyBase::end.
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_conc
unsigned int dim() const
Return dimension of element appropriate to cell.
@ update_normal_vectors
Normal vectors.
unsigned int dim() const
Return dimension of element appropriate to the side.
void begin() override
Implements AssemblyBase::begin.
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
void begin() override
Implements AssemblyBase::begin.
MultiField< 3, FieldValue< 3 >::Scalar > init_conc
Initial concentrations.
std::vector< double > row_values_
std::shared_ptr< Balance > balance_
object for calculation and writing the mass balance to file, shared with EquationBase.
MultiField< 3, FieldValue< 3 >::Scalar > sources_sigma
Concentration sources - Robin type, in_flux = sources_sigma * (sources_conc - mobile_conc)
Definitions of basic Lagrangean finite elements with polynomial shape functions.
void set(unsigned int pos, double val)
Set value on given position.
Side accessor allows to iterate over sides of DOF handler cell.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
ConvectionTransport::EqFields EqFields
ConvectionTransport::EqFields EqFields
double transport_matrix_time
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
std::vector< LongIdx > side_dofs_
unsigned int max_edg_sides
Maximal number of edge sides (evaluate from dim 1,2,3)
Definitions of particular quadrature rules on simplices.
unsigned int n_substances()
Returns number of transported substances.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
std::vector< double > side_flux_
~MassAssemblyConvection()
Destructor.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
static constexpr const char * name()
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
void edge_integral(RangeConvert< DHEdgeSide, DHCellSide > edge_side_range)
Assembles the fluxes between sides of elements of the same dimension.
double transport_bc_time
Time of the last update of the boundary condition terms.
Container for various descendants of FieldCommonBase.
EqFields * eq_fields_
Data objects shared with TransportDG.
ElementAccessor< 3 > element_accessor()
FEValues< 3 > fe_values_side_
FEValues of object (of P disc finite element type)
vector< LongIdx > dof_indices_i_
FieldSet used_fields_
Sub field set contains fields used in calculation.
FieldFEScalarVec conc_mobile_fe
Underlaying FieldFE for each substance of conc_mobile.
static constexpr const char * name()
ElementAccessor< 3 > element() const
vector< LongIdx > dof_indices_j_
Global DOF indices.
FieldSet used_fields_
Sub field set contains fields used in calculation.
Range< BulkPoint > bulk_points(unsigned int element_patch_idx) const
Return BulkPoint range of appropriate dimension.
vector< FEValues< 3 > > fe_values_vec_
Vector of FEValues of object (of P disc finite element types)
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
bool sources_changed_
Flag indicates that sources part of equation was changed during last time.
Cell accessor allow iterate over DOF handler cells.
ConcSourcesBdrAssemblyConvection(EqFields *eq_fields, EqData *eq_data)
Constructor.
Mat tm
PETSc transport matrix.
int active_integrals_
Holds mask of active integrals.
ConvectionTransport::EqData EqData
std::vector< LongIdx > all_elem_dofs_
static constexpr const char * name()
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
ConvectionTransport::EqData EqData
ConvectionTransport::EqFields EqFields
~InitCondAssemblyConvection()
Destructor.
VectorMPI cfl_flow_
Parallel vector for flow contribution to CFL condition.
MatrixMpiAssemblyConvection(EqFields *eq_fields, EqData *eq_data)
Constructor.
void boundary_side_integral(DHCellSide cell_side)
Assembles the fluxes on the boundary.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
MassAssemblyConvection(EqFields *eq_fields, EqData *eq_data)
Constructor.
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles the fluxes between elements of different dimensions.
double get(unsigned int pos) const
Return value on given position.
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
MultiField< 3, FieldValue< 3 >::Scalar > sources_density
Concentration sources - density of substance source, only positive part is used.
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
void begin() override
Implements AssemblyBase::begin.
ConvectionTransport::EqData EqData
@ update_side_JxW_values
Transformed quadrature weight for cell sides.
static constexpr const char * name()
InitCondAssemblyConvection(EqFields *eq_fields, EqData *eq_data)
Constructor.
MultiField< 3, FieldValue< 3 >::Scalar > sources_conc
bool is_convection_matrix_scaled
Flag indicates the state of object.
FieldSet used_fields_
Sub field set contains fields used in calculation.
void add_global(unsigned int pos, double val)
Add value to item on given global position.
Range< CouplingPoint > coupling_points(const DHCellSide &cell_side) const
Return CouplingPoint range of appropriate dimension.
IterConvert< ObjectIn, ObjectOut > begin()
Iterator to begin item of range.
Vec & petsc_vec()
Getter for PETSC vector of output data (e.g. can be used by scatters).
unsigned int bulk_idx() const
Returns index of the region in the bulk set.
std::shared_ptr< DOFHandlerMultiDim > dh_
Generic class of assemblation.
EqFields * eq_fields_
Data objects shared with TransportDG.
Range< BoundaryPoint > boundary_points(const DHCellSide &cell_side) const
Return BoundaryPoint range of appropriate dimension.
ElementCacheMap * element_cache_map_
ElementCacheMap shared with GenericAssembly object.
double measure() const
Computes the measure of the element.
std::vector< VectorMPI > vecs_
Set of data vectors of conc_mobile_fe objects.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
unsigned int IntDim
A dimension index type.