Flow123d
JB_transport-9331eee
|
Go to the documentation of this file.
18 #ifndef ASSEMBLY_OBSERVE_HH_
19 #define ASSEMBLY_OBSERVE_HH_
21 #include <unordered_map>
39 template <
template<
IntDim...>
class DimAssembly>
44 GenericAssemblyObserve(
typename DimAssembly<1>::EqFields *eq_fields,
const std::unordered_set<string> &observe_fields_list,
45 std::shared_ptr<Observe> observe)
69 void assemble(std::shared_ptr<DOFHandlerMultiDim> dh)
override {
72 unsigned int i_ep, subset_begin, subset_idx;
73 auto &patch_point_data =
observe_->patch_point_data();
74 for(
auto & p_data : patch_point_data) {
76 subset_begin =
eval_points_->subset_begin(p_data.i_quad+1, subset_idx);
77 i_ep = subset_begin + p_data.i_quad_point;
78 DHCellAccessor dh_cell = dh->cell_accessor_from_element(p_data.elem_idx);
111 template <
unsigned int dim>
117 static constexpr
const char *
name() {
return "AssemblyObserveOutput"; }
125 for (
auto observe_field : observe_fields_list) {
141 unsigned int element_patch_idx, field_value_cache_position, val_idx;
143 for (
unsigned int i=0; i<bulk_integral_data.
permanent_size(); ++i) {
144 if (bulk_integral_data[i].cell.dim() != dim)
continue;
146 auto p = *( this->
bulk_points(element_patch_idx).begin());
149 this->
offsets_[field_value_cache_position] = val_idx;
162 for(
auto & p_data : patch_point_data) {
164 if (el_acc.dim()!=dim)
continue;
166 p_data.i_quad = el_acc.dim() - 1;
167 p_data.i_quad_point = reg_points.size();
168 reg_points.push_back(p_data.local_coords);
171 if (reg_points.size() > 0) {
173 for (
uint j=0; j<reg_points.size(); j++) {
174 arma::vec::fixed<dim> fix_p = reg_points[j].subvec(0, dim-1);
196 template <
template<
IntDim...>
class DimAssembly>
AssemblyIntegrals integrals_
Holds integral objects.
const Mesh * mesh() const
Returns pointer to mesh.
void assemble_cell_integrals(const RevertableList< GenericAssemblyBase::BulkIntegralData > &bulk_integral_data)
Assembles the cell integrals for the given dimension.
static unsigned int get()
Return number of stored elements.
Set of all used integral necessary in assemblation.
void create_patch()
Create patch of cached elements before reading data to cache.
~AssemblyObserveOutput()
Destructor.
std::size_t make_permanent()
Finalize temporary part of data.
EqFields * eq_fields_
Data objects shared with EquationOutput.
std::size_t emplace_back(Args &&... args)
unsigned int position_in_cache(unsigned mesh_elm_idx, bool bdr=false) const
Return position of element stored in ElementCacheMap.
std::shared_ptr< EvalPoints > eval_points_
EvalPoints object shared by all integrals.
std::shared_ptr< Observe > observe_
Shared Observe object.
Directing class of FieldValueCache.
std::size_t permanent_size() const
Return permanent size of list.
Range< FieldListAccessor > fields_range() const
Returns range of Fields held in field_list.
std::shared_ptr< BulkIntegral > bulk_
Bulk integrals of elements.
RevertableList< BulkIntegralData > bulk_integral_data_
Holds data for computing bulk integrals.
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
GenericAssemblyObserve(typename DimAssembly< 1 >::EqFields *eq_fields, const std::unordered_set< string > &observe_fields_list, std::shared_ptr< Observe > observe)
Constructor.
void reset()
Clear the list.
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
unsigned int idx() const
Returns a global index of the region.
std::vector< int > offsets_
Holds indices (offsets) of cached data to output data vector.
RevertableList< EvalPointData > eval_point_data_
DimIntegrals integrals_
Set of used integrals.
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
Point accessor allow iterate over local Observe points.
std::array< std::shared_ptr< BulkIntegral >, 3 > bulk_
Bulk integrals of elements of dimensions 1, 2, 3.
ElementCacheMap element_cache_map_
ElementCacheMap according to EvalPoints.
void clear_element_eval_points_map()
Reset all items of elements_eval_points_map.
Armor::Array< double >::ArrayMatSet set(uint i)
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
double weight(unsigned int i) const
Returns the ith weight.
void reallocate_cache()
Calls cache_reallocate method on set of used fields.
int element_eval_point(unsigned int i_elem_in_cache, unsigned int i_eval_point) const
PatchPointVec & patch_point_data()
Getter of patch_point_data.
Container for various descendants of FieldCommonBase.
Range< BulkPoint > bulk_points(unsigned int element_patch_idx) const
Return BulkPoint range of appropriate dimension.
Cell accessor allow iterate over DOF handler cells.
MixedPtr< DimAssembly, 1 > multidim_assembly_
Assembly object.
unsigned int loc_point_time_index() const
Return local index in data cache (combination of local point index and index of stored time)
void create_observe_integrals(std::shared_ptr< EvalPoints > eval_points, AssemblyIntegrals &integrals)
Create bulk integral according to dim.
int active_integrals_
Holds mask of active integrals.
AssemblyObserveOutput(EqFields *eq_fields, const std::unordered_set< string > &observe_fields_list, Observe *observe)
Constructor.
static constexpr const char * name()
FieldSet used_fields_
Sub field set contains fields performed to output.
Generic class of observe output assemblation.
OutputDataPtr get_output_cache(std::string field_name)
Base class for quadrature rules on simplices in arbitrary dimensions.
#define START_TIMER(tag)
Starts a timer with specified tag.
ElementCacheMap * element_cache_map_
ElementCacheMap shared with GenericAssembly object.
#define END_TIMER(tag)
Ends a timer with specified tag.
RegionIdx region_idx() const
Quadrature * quad_
Quadrature used in assembling methods.
FieldCommon * field(const std::string &field_name) const
unsigned int IntDim
A dimension index type.