FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
meshopt_control.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5#pragma once
6
8#include <kernel/assembly/grid_transfer.hpp>
9#include <kernel/assembly/mirror_assembler.hpp>
10#include <kernel/assembly/unit_filter_assembler.hpp>
11#include <kernel/assembly/slip_filter_assembler.hpp>
12#include <kernel/lafem/sparse_matrix_csr.hpp>
13#include <kernel/lafem/sparse_matrix_bcsr.hpp>
14#include <kernel/lafem/sparse_matrix_bwrappedcsr.hpp>
15#include <kernel/lafem/transfer.hpp>
16#include <kernel/lafem/vector_mirror.hpp>
17#include <kernel/geometry/mesh_file_writer.hpp>
18#include <kernel/global/filter.hpp>
19#include <kernel/global/gate.hpp>
20#include <kernel/global/matrix.hpp>
21#include <kernel/global/muxer.hpp>
22#include <kernel/global/nonlinear_functional.hpp>
23#include <kernel/global/transfer.hpp>
24#include <kernel/global/vector.hpp>
25
26#include <control/domain/domain_control.hpp>
27
28namespace FEAT
29{
30 namespace Control
31 {
35 namespace Meshopt
36 {
39 template<typename, typename, template<typename, typename> class>
40 class MeshoptSystemLevel;
41
42 template<typename, typename, template<typename, typename> class>
43 class QuadraticSystemLevel;
44
45 template<typename, typename, template<typename, typename> class>
46 class NonlinearSystemLevel;
47
49
60 template<typename DomainControl_>
62 {
63 public:
65 typedef DomainControl_ DomainControl;
67 typedef typename DomainControl_::LevelType DomainLevel;
69 typedef typename DomainControl_::MeshType MeshType;
70
72 static constexpr int world_dim = DomainControl_::MeshType::world_dim;
74 typedef typename DomainControl_::MeshType::CoordType CoordType;
75
83
86
87 protected:
91 std::deque<String> _dirichlet_boundaries;
93 std::deque<String> _slip_boundaries;
94
95 public:
96
100 explicit MeshoptControlBase(DomainControl& dom_ctrl_, const std::deque<String>& dirichlet_boundaries,
101 const std::deque<String>& slip_boundaries)
102 : _dom_ctrl(dom_ctrl_),
103 _dirichlet_boundaries(dirichlet_boundaries),
104 _slip_boundaries(slip_boundaries)
105 {
106 }
107
112 {
113 }
114
116 // * \brief Gets a const reference to the mesh at a certain level
117 // */
118 //const MeshType& get_mesh(Index lvl)
119 //{
120 // return _dom_ctrl.at(lvl)->get_mesh();
121 //}
122
159 virtual CoordType compute_cell_size_defect(CoordType& lambda_min, CoordType& lambda_max,
160 CoordType& vol_min, CoordType& vol_max, CoordType& vol) const = 0;
161
165 virtual void optimize() = 0;
166
174 virtual void prepare(const GlobalCoordsBuffer& DOXY(vec_state)) = 0;
175
179 virtual void mesh_to_buffer() = 0;
180
184 virtual void buffer_to_mesh() = 0;
185
192
201 const std::deque<String>& get_dirichlet_boundaries() const
202 {
204 }
205
214 const std::deque<String>& get_slip_boundaries() const
215 {
216 return _slip_boundaries;
217 }
218
224 virtual size_t get_num_levels() const = 0;
225
231 virtual String name() const = 0;
232
243 (Geometry::ExportVTK<MeshType>& DOXY(exporter), const int DOXY(lvl_index)) const
244 {
245 }
246
250 virtual String info() const = 0;
251
252
275 void compute_mesh_quality(CoordType& edge_angle, CoordType& qi_min, CoordType& qi_mean,
276 CoordType* edge_angle_cellwise = nullptr, CoordType* qi_cellwise = nullptr,
277 int lvl_index = -1) const
278 {
279 // max_level_index cannot be called for the default argument, so we do it here
280 if(lvl_index == -1)
281 {
282 lvl_index = _dom_ctrl.max_level_index();
283 }
284 XASSERT(lvl_index >= _dom_ctrl.min_level_index());
285 XASSERT(lvl_index <= _dom_ctrl.max_level_index());
286
287 const Dist::Comm& comm = _dom_ctrl.comm();
288
289 CoordType qi_sum(0);
290
291 for(std::size_t i(0u); i < _dom_ctrl.size_physical(); ++i)
292 {
293 const auto& dom_lvl = *_dom_ctrl.at(i);
294 if(dom_lvl.get_level_index() == lvl_index)
295 {
296 const auto& my_mesh = dom_lvl.get_mesh();
297
298 Index ncells(my_mesh.get_num_entities(MeshType::shape_dim));
299 comm.allreduce(&ncells, &ncells, std::size_t(1), Dist::op_sum);
300
302 my_mesh.template get_index_set<MeshType::shape_dim, 0>(), my_mesh.get_vertex_set(), qi_cellwise);
303
304 comm.allreduce(&qi_min, &qi_min, std::size_t(1), Dist::op_min);
305 comm.allreduce(&qi_sum, &qi_sum, std::size_t(1), Dist::op_sum);
306
308 my_mesh.template get_index_set<MeshType::shape_dim, 0>(), my_mesh.get_vertex_set(), edge_angle_cellwise);
309 comm.allreduce(&edge_angle, &edge_angle, std::size_t(1), Dist::op_min);
310
311 qi_mean = qi_sum/CoordType(ncells);
312
313 return;
314 }
315 }
316
317 // We should never get to this point
318 XABORTM("Could not find level with index "+stringify(lvl_index)+"!\n");
319
320 }
321 }; // class MeshoptControlBase
322
323
337 template
338 <
339 typename DT_, typename IT_,
340 template<typename, typename> class Functional_
341 >
343 {
344 public:
346 typedef DT_ DataType;
348 typedef IT_ IndexType;
349
351 typedef Functional_<DT_, IT_> LocalFunctional;
352
354 typedef typename LocalFunctional::SpaceType SpaceType;
356 typedef typename LocalFunctional::TrafoType TrafoType;
358 typedef typename TrafoType::MeshType MeshType;
359
361 typedef typename LocalFunctional::VectorTypeL LocalSystemVectorL;
363 typedef typename LocalFunctional::VectorTypeR LocalSystemVectorR;
365 typedef typename LocalFunctional::ScalarVectorType LocalScalarVector;
367 typedef typename LocalFunctional::CoordsBufferType LocalCoordsBuffer;
373
375 typedef typename LocalFunctional::FilterType LocalSystemFilter;
377 typedef typename LocalFunctional::SlipFilterSequence LocalSlipFilterSequence;
379 typedef typename LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence;
380
382 //typedef LAFEM::VectorMirrorBlocked<DT_, IT_, LocalFunctional::BlockHeight> SystemMirror;
390
405
406 public:
421
422 private:
424 const int _level_index;
425
426 public:
452 template<typename... Args_>
453 explicit MeshoptSystemLevel(const int level_index,
455 TrafoType& trafo,
456 const std::deque<String>& dirichlet_list,
457 const std::deque<String>& slip_list,
458 Args_&&... args) :
459 local_functional(rmn, trafo, dirichlet_list, slip_list, std::forward<Args_>(args)...),
460 gate_sys(),
461 filter_sys(),
462 coords_buffer(&gate_sys, local_functional.get_coords().clone(LAFEM::CloneMode::Shallow)),
465 _level_index(level_index)
466 {
467
468 LocalSlipFilterSequence slip_sequence(slip_list);
469 LocalDirichletFilterSequence dirichlet_sequence(dirichlet_list);
470
471 LocalSystemFilter local_filter (std::move(slip_sequence), std::move(dirichlet_sequence));
472
473 filter_sys.local() = std::move(local_filter);
474
475 }
476
483
488 {
489 }
490
498 int get_level_index() const
499 {
500 return _level_index;
501 }
502
508 bool empty() const
509 {
510 return local_functional.empty();
511 }
512
517 {
518 return GlobalSystemVectorL(&gate_sys, local_functional.create_vector_l());
519 }
520
525 {
526 return GlobalSystemVectorR(&gate_sys, local_functional.create_vector_r());
527 }
528
529
538 {
539 // Sync the filter vectors in the SlipFilters
540 auto& slip_filters = filter_sys.local().template at<0>();
541 {
542 for(auto& it : slip_filters)
543 {
544 // Get the filter vector
545 auto& slip_filter_vector = it.second.get_filter_vector();
546
547 if(slip_filter_vector.used_elements() > 0)
548 {
549 // Temporary DenseVector for syncing
550 LocalSystemVectorL tmp(slip_filter_vector.size());
551 auto* tmp_elements = tmp.template elements<LAFEM::Perspective::native>();
552 auto* sfv_elements = slip_filter_vector.template elements<LAFEM::Perspective::native>();
553
554 // Copy sparse filter vector contents to DenseVector
555 for(Index isparse(0); isparse < slip_filter_vector.used_elements(); ++isparse)
556 {
557 Index idense(slip_filter_vector.indices()[isparse]);
558 tmp_elements[idense] = sfv_elements[isparse];
559 }
560
561 gate_sys.sync_0(tmp);
562
563 // Copy sparse filter vector contents to DenseVector
564 for(Index isparse(0); isparse < slip_filter_vector.used_elements(); ++isparse)
565 {
566 Index idense(slip_filter_vector.indices()[isparse]);
567 sfv_elements[isparse] = tmp_elements[idense];
568 }
569 }
570 else
571 {
572 // Temporary DenseVector for syncing
573 LocalSystemVectorL tmp(slip_filter_vector.size());
574 gate_sys.sync_0(tmp);
575 }
576 }
577
578 } // evil slip filter sync
579
580 }
581
590 {
591 XASSERTM(!empty(), "Assemble_rhs_vector for empty functional");
592
593 // create new vector
595
596 vec_rhs.format();
597 filter_sys.filter_rhs(vec_rhs);
598
599 return vec_rhs;
600 }
601
608 {
609 XASSERTM(!empty(), "Assemble_sol_vector for empty functional");
611
612 vec_sol.local().copy(coords_buffer.local());
613 filter_sys.local().template at<1>().filter_sol(vec_sol.local());
614
615 return vec_sol;
616 }
617
628 template<typename DomainLayer_>
629 void assemble_gates(const DomainLayer_& dom_layer)
630 {
631 // set the gate comm
632 gate_sys.set_comm(dom_layer.comm_ptr());
633 gate_scalar.set_comm(dom_layer.comm_ptr());
634
635 // Loop over all ranks
636 for(Index i(0); i < dom_layer.neighbor_count(); ++i)
637 {
638 int rank(dom_layer.neighbor_rank(i));
639
640 // try to find our halo
641 auto* halo = local_functional.get_mesh_node()->get_halo(rank);
642 XASSERTM(halo != nullptr, "Halo not found.");
643
644 // assemble the system mirror
645 SystemMirror sys_mirror;
646 Assembly::MirrorAssembler::assemble_mirror(sys_mirror, local_functional.trafo_space, *halo);
647
648 // push mirror into gates
649 gate_sys.push(rank, std::move(sys_mirror));
650
651 // assemble the scalar mirror
652 ScalarMirror scalar_mirror;
653 Assembly::MirrorAssembler::assemble_mirror(scalar_mirror, local_functional.trafo_space, *halo);
654
655 // push mirror into gates
656 gate_scalar.push(rank, std::move(scalar_mirror));
657 }
658
659 // create local template vectors
660 LocalSystemVectorR tmp_sys(local_functional.trafo_space.get_num_dofs());
661 LocalScalarVector tmp_scalar(local_functional.trafo_space.get_num_dofs());
662
663 // compile gates
664 gate_sys.compile(std::move(tmp_sys));
665 gate_scalar.compile(std::move(tmp_scalar));
666 }
667
676 {
677 // get global transfer operator
678 GlobalSystemTransfer& glob_trans = this->transfer_sys;
679
680 // get local transfer operator
681 LocalSystemTransfer& loc_trans = glob_trans.local();
682
683 // get local transfer matrices
684 typename LocalSystemTransferMatrix::BaseClass& loc_prol = loc_trans.get_mat_prol();
685 typename LocalSystemTransferMatrix::BaseClass& loc_rest = loc_trans.get_mat_rest();
686
687 // assemble structure?
688 if (loc_prol.empty())
689 {
691 loc_prol, local_functional.trafo_space, level_coarse.local_functional.trafo_space);
692 }
693
694 // Create a global scalar weight vector
695 GlobalScalarVector glob_vec_weight( &this->gate_scalar, loc_prol.create_vector_l());
696 // Get local scalar weight vector
697 auto& loc_vec_weight = glob_vec_weight.local();
698
699 // Assemble the underlying scalar prolongation matrix
700 {
701 Cubature::DynamicFactory cubature_factory("auto-degree:3");
702
703 loc_prol.format();
704 loc_vec_weight.format();
705
706 // Assemble prolongation matrix
707 Assembly::GridTransfer::assemble_prolongation(loc_prol, loc_vec_weight,
708 local_functional.trafo_space, level_coarse.local_functional.trafo_space, cubature_factory);
709
710 // Synchronize weight vector
711 glob_vec_weight.sync_0();
712
713 // Invert components
714 loc_vec_weight.component_invert(loc_vec_weight);
715
716 // Scale prolongation matrix
717 loc_prol.scale_rows(loc_prol, loc_vec_weight);
718
719 // Copy and transpose
720 loc_rest = loc_prol.transpose();
721 }
722 }
723
724 }; // class MeshoptSystemLevel
725
742 template
743 <
744 typename DT_, typename IT_,
745 template<typename, typename> class Functional_
746 >
747 class QuadraticSystemLevel : public MeshoptSystemLevel<DT_, IT_, Functional_>
748 {
749 public:
751 typedef DT_ DataType;
753 typedef IT_ IndexType;
754
757
759 typedef Functional_<DT_, IT_> LocalFunctional;
760
762 typedef typename LocalFunctional::SpaceType SpaceType;
764 typedef typename LocalFunctional::TrafoType TrafoType;
766 typedef typename TrafoType::MeshType MeshType;
767
769 typedef typename LocalFunctional::MatrixType LocalMatrix;
783
785 typedef typename LocalFunctional::FilterType LocalSystemFilter;
787 typedef typename LocalFunctional::SlipFilterSequence LocalSlipFilterSequence;
789 typedef typename LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence;
790
799
816
817 public:
820
821 public:
847 template<typename... Args_>
848 explicit QuadraticSystemLevel(const int level_index,
850 TrafoType& trafo,
851 const std::deque<String>& dirichlet_list,
852 const std::deque<String>& slip_list,
853 Args_&&... args) :
854 BaseClass(level_index, rmn, trafo, dirichlet_list, slip_list, std::forward<Args_>(args)...),
856 BaseClass::local_functional.matrix_sys.clone(LAFEM::CloneMode::Shallow))
857 {
858 }
859
864 {
865 }
866
867 }; // class QuadraticSystemLevel<...>
868
884 template
885 <
886 typename DT_, typename IT_,
887 template<typename, typename> class Functional_
888 >
889 class NonlinearSystemLevel : public MeshoptSystemLevel<DT_, IT_, Functional_>
890 {
891 public:
893 typedef DT_ DataType;
895 typedef IT_ IndexType;
896
898 typedef Functional_<DT_, IT_> LocalFunctional;
899
902
904 typedef typename LocalFunctional::SpaceType SpaceType;
906 typedef typename LocalFunctional::TrafoType TrafoType;
908 typedef typename TrafoType::MeshType MeshType;
909
911 typedef typename LocalFunctional::VectorTypeL LocalSystemVectorL;
913 typedef typename LocalFunctional::VectorTypeR LocalSystemVectorR;
915 typedef typename LocalFunctional::ScalarVectorType LocalScalarVector;
917 typedef typename LocalFunctional::CoordsBufferType LocalCoordsBuffer;
923
925 typedef typename LocalFunctional::FilterType LocalSystemFilter;
927 typedef typename LocalFunctional::SlipFilterSequence LocalSlipFilterSequence;
929 typedef typename LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence;
930
939
956
957 public:
960
961 public:
987 template<typename... Args_>
988 explicit NonlinearSystemLevel(const int level_index,
990 TrafoType& trafo,
991 const std::deque<String>& dirichlet_list,
992 const std::deque<String>& slip_list,
993 Args_&&... args) :
994 BaseClass(level_index, rmn, trafo, dirichlet_list, slip_list, std::forward<Args_>(args)...),
996 {
997 }
998
1003 {
1004 }
1005
1006 }; // class NonlinearSystemLevel<...>
1007
1008 } // namespace Meshopt
1009
1010 } // namespace Control
1011} //namespace FEAT
#define XABORTM(msg)
Abortion macro definition with custom message.
Definition: assertion.hpp:192
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Definition: assertion.hpp:263
FEAT Kernel base header.
static void assemble_prolongation(Matrix_ &matrix, Vector_ &vector, const FineSpace_ &fine_space, const CoarseSpace_ &coarse_space, const String &cubature_name)
Assembles a prolongation matrix and its corresponding weight vector.
static void assemble_mirror(LAFEM::VectorMirror< DataType_, IndexType_ > &vec_mirror, const Space_ &space, const MeshPart_ &mesh_part)
Assembles a VectorMirror from a space and a mesh-part.
static void assemble_matrix_2lvl(MatrixType_ &matrix, const FineSpace_ &fine_space, const CoarseSpace_ &coarse_space)
Assembles a 2-level matrix structure from a fine-coarse-space pair.
Base class for Meshopt control objects.
DomainControl_::MeshType MeshType
The type of mesh the DomainControl uses.
DomainControl & _dom_ctrl
The domain control whose mesh objects can be modified.
DomainControl_::MeshType::CoordType CoordType
Floating point type for coordinates.
std::deque< String > _dirichlet_boundaries
List of all meshparts with dirichlet boundary conditions.
virtual String name() const =0
Returns a descriptive String.
virtual void mesh_to_buffer()=0
Copies the mesh's vertex coordinates to the buffer vector.
void compute_mesh_quality(CoordType &edge_angle, CoordType &qi_min, CoordType &qi_mean, CoordType *edge_angle_cellwise=nullptr, CoordType *qi_cellwise=nullptr, int lvl_index=-1) const
Computes mesh quality heuristics.
DomainControl_ DomainControl
The type of the underlying domain control.
virtual ~MeshoptControlBase()
Empty virtual destructor.
DomainControl_::LevelType DomainLevel
The type of levels of DomainControl.
const std::deque< String > & get_dirichlet_boundaries() const
Gets the names of all Dirichlet boundaries.
virtual void add_to_vtk_exporter(Geometry::ExportVTK< MeshType > &exporter, const int lvl_index) const
Adds quantities of the underlying mesh quality functional to a given exporter object.
virtual void optimize()=0
Optimizes the current mesh.
LAFEM::DenseVectorBlocked< CoordType, Index, world_dim > LocalCoordsBuffer
Global::Vector< LocalCoordsBuffer, CoordsMirror > GlobalCoordsBuffer
The global version of LocalCoordsBuffer, needed for prepare setting the internal state variable.
std::deque< String > _slip_boundaries
List of all meshparts with slipboundary conditions.
LAFEM::VectorMirror< CoordType, Index > CoordsMirror
corresponding vector mirror
static constexpr int world_dim
The world dimension, i.e. number of coordinates.
virtual CoordType compute_cell_size_defect(CoordType &lambda_min, CoordType &lambda_max, CoordType &vol_min, CoordType &vol_max, CoordType &vol) const =0
‍**
virtual String info() const =0
Prints settings of the control object.
virtual size_t get_num_levels() const =0
Get the number of levels in this object.
Geometry::ExportVTK< MeshType > VTKExporterType
Type of the vtk exporter this (and derived classes) can write to.
virtual void prepare(const GlobalCoordsBuffer &vec_state)=0
Sets the internal state variable.
const std::deque< String > & get_slip_boundaries() const
Gets the names of all slip boundaries.
virtual void buffer_to_mesh()=0
Copies the contents of the buffer vector to the mesh's vertex coordinates.
MeshoptControlBase(DomainControl &dom_ctrl_, const std::deque< String > &dirichlet_boundaries, const std::deque< String > &slip_boundaries)
The simplest constructor possible.
virtual GlobalCoordsBuffer & get_coords()=0
Gets the coordinates buffer vector.
DT_ DataType
Floating point precision for the solver.
LAFEM::SparseMatrixBWrappedCSR< DT_, IT_, LocalFunctional::MeshType::world_dim > LocalSystemTransferMatrix
Local inter-level transfer matrix.
Global::Transfer< LocalSystemTransfer, SystemMirror > GlobalSystemTransfer
Global system transfer operator.
Global::Vector< LocalSystemVectorL, SystemMirror > GlobalSystemVectorL
Global left-vectors.
GlobalSystemTransfer transfer_sys
The global transfer operator from this level to the next coarser one.
int get_level_index() const
Returns the level index.
void assemble_gates(const DomainLayer_ &dom_layer)
Assembles the gates on this level on a given DomainLayer.
LocalFunctional::SlipFilterSequence LocalSlipFilterSequence
This is comprised of a sequence of SlipFilters...
GlobalSystemVectorL create_vector_l() const
Creates a new (left) vector.
LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence
... and a sequence of UnitFilters
virtual ~MeshoptSystemLevel()
Empty virtual destructor.
LocalFunctional::VectorTypeL LocalSystemVectorL
Local left-vectors (dual space)
MeshoptSystemLevel()=delete
Explicitly delete default constructor.
IT_ IndexType
Index type for the solver.
LocalFunctional::TrafoType TrafoType
The underlying transformation.
bool empty() const
Returns if the local functional is empty.
LAFEM::VectorMirror< DT_, IT_ > SystemMirror
Mirrors for system vectors.
LocalFunctional::ScalarVectorType LocalScalarVector
Local vectors of scalar quantities.
MeshoptSystemLevel(const MeshoptSystemLevel &)=delete
Explicitly delete the copy constructor.
LocalFunctional::VectorTypeR LocalSystemVectorR
Local right-vectors (primal space)
Global::Filter< LocalSystemFilter, SystemMirror > GlobalSystemFilter
Global system filter type.
GlobalCoordsBuffer coords_buffer
This contains a shallow copy of the operator's coords_buffer.
void sync_system_filter()
Synchronizes the system filters.
Functional_< DT_, IT_ > LocalFunctional
The (patch-)local mesh quality functional.
Global::Gate< LocalSystemVectorR, SystemMirror > SystemGate
Gates for the system.
Global::Vector< LocalSystemVectorR, SystemMirror > GlobalSystemVectorR
Global right-vectors.
GlobalSystemVectorR assemble_sol_vector() const
Assembles an intial guess vector.
const int _level_index
This is the number of refines it took from the mesh at the file level to here.
MeshoptSystemLevel(const int level_index, Geometry::RootMeshNode< MeshType > *rmn, TrafoType &trafo, const std::deque< String > &dirichlet_list, const std::deque< String > &slip_list, Args_ &&... args)
Variadic template constructor.
GlobalSystemMuxer coarse_muxer_sys
The global partition muxer on this level.
Global::Gate< LocalScalarVector, ScalarMirror > ScalarGate
Gates for scalar vectors.
LocalFunctional::CoordsBufferType LocalCoordsBuffer
Local coordinates buffer type for passing information to or from the mesh.
LAFEM::VectorMirror< DT_, IT_ > ScalarMirror
Mirrors for scalar vectors.
Global::Vector< LocalScalarVector, ScalarMirror > GlobalScalarVector
Global scalar vector type.
LocalFunctional local_functional
The (patch-)local mesh quality functional.
GlobalSystemVectorR create_vector_r() const
Creates a new (right) vector.
Global::Muxer< LocalSystemVectorR, SystemMirror > GlobalSystemMuxer
The global muxer for mapping data from one partitioning to the other on this level.
GlobalSystemVectorL assemble_rhs_vector() const
Assembles a right hand side vector.
LocalFunctional::FilterType LocalSystemFilter
Filter for the local system.
void assemble_system_transfer(const MeshoptSystemLevel &level_coarse)
Assembles the transfer operators from this level to a coarser one.
TrafoType::MeshType MeshType
The type of mesh we use.
LocalFunctional::SpaceType SpaceType
The finite element space.
LAFEM::Transfer< LocalSystemTransferMatrix > LocalSystemTransfer
Local transfer operator.
Global::Vector< LocalCoordsBuffer, SystemMirror > GlobalCoordsBuffer
Global coordinates buffer.
GlobalSystemFilter filter_sys
The global filter.
MeshoptSystemLevel(MeshoptSystemLevel &&)=delete
Explicitly delete the move constructor. This could be useful to have, though.
(Non)linear system of equations on one mesh refinement level
LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence
... and a sequence of UnitFilters
Functional_< DT_, IT_ > LocalFunctional
(Patch-) Local mesh quality functional type
LAFEM::VectorMirror< DT_, IT_ > SystemMirror
Mirrors for system vectors.
LocalFunctional::SlipFilterSequence LocalSlipFilterSequence
This is comprised of a sequence of SlipFilters...
MeshoptSystemLevel< DT_, IT_, Functional_ > BaseClass
Our base class.
LocalFunctional::VectorTypeL LocalSystemVectorL
Local left-vectors (dual space)
Global::Filter< LocalSystemFilter, SystemMirror > GlobalSystemFilter
Global system filter type.
DT_ DataType
Floating point precision for the solver.
NonlinearSystemLevel(const int level_index, Geometry::RootMeshNode< MeshType > *rmn, TrafoType &trafo, const std::deque< String > &dirichlet_list, const std::deque< String > &slip_list, Args_ &&... args)
Variadic template constructor.
LocalFunctional::TrafoType TrafoType
The underlying transformation.
Global::Vector< LocalCoordsBuffer, SystemMirror > GlobalCoordsBuffer
Global coordinates buffer.
virtual ~NonlinearSystemLevel()
Empty virtual destructor.
LocalFunctional::SpaceType SpaceType
The finite element space.
LAFEM::VectorMirror< DT_, IT_ > ScalarMirror
Mirrors for scalar vectors.
TrafoType::MeshType MeshType
The type of mesh we use.
Global::Vector< LocalScalarVector, ScalarMirror > GlobalScalarVector
Global scalar vector type.
LocalFunctional::CoordsBufferType LocalCoordsBuffer
Local coordinates buffer type for passing information to or from the mesh.
Global::Vector< LocalSystemVectorR, SystemMirror > GlobalSystemVectorR
Global right-vectors.
LocalFunctional::FilterType LocalSystemFilter
Filter for the local system.
LocalFunctional::VectorTypeR LocalSystemVectorR
Local right-vectors (primal space)
Global::Gate< LocalScalarVector, ScalarMirror > ScalarGate
Gates for scalar vectors.
Global::Vector< LocalSystemVectorL, SystemMirror > GlobalSystemVectorL
Global left-vectors.
Global::Muxer< LocalSystemVectorR, SystemMirror > GlobalSystemMuxer
The global muxer for mapping data from one partitioning to the other on this level.
Global::NonlinearFunctional< LocalFunctional, SystemMirror, SystemMirror > GlobalFunctional
Global mesh quality functional type.
LocalFunctional::ScalarVectorType LocalScalarVector
Local vectors of scalar quantities.
Global::Gate< LocalSystemVectorR, SystemMirror > SystemGate
Gates for the system.
LAFEM::Transfer< LocalSystemTransferMatrix > LocalSystemTransfer
Local transfer operator.
LAFEM::SparseMatrixBWrappedCSR< DT_, IT_, LocalFunctional::MeshType::world_dim > LocalSystemTransferMatrix
Local inter-level transfer matrix.
GlobalFunctional global_functional
The global nonlinear functional.
Global::Transfer< LocalSystemTransfer, SystemMirror > GlobalSystemTransfer
Global system transfer operator.
SystemLevel for a quadratic mesh quality functional leading to a linear system.
Global::Vector< LocalSystemVectorR, SystemMirror > GlobalSystemVectorR
Global right-vectors.
BaseClass::SystemMirror SystemMirror
Mirrors for system vectors.
Functional_< DT_, IT_ > LocalFunctional
(Patch-) Local mesh quality functional type
LocalFunctional::SlipFilterSequence LocalSlipFilterSequence
This is comprised of a sequence of SlipFilters...
virtual ~QuadraticSystemLevel()
Empty virtual destructor.
DT_ DataType
Floating point precision for the solver.
Global::Filter< LocalSystemFilter, SystemMirror > GlobalSystemFilter
Global system filter type.
TrafoType::MeshType MeshType
The type of mesh we use.
Global::Vector< LocalScalarVector, ScalarMirror > GlobalScalarVector
Global scalar vector type.
QuadraticSystemLevel(const int level_index, Geometry::RootMeshNode< MeshType > *rmn, TrafoType &trafo, const std::deque< String > &dirichlet_list, const std::deque< String > &slip_list, Args_ &&... args)
Variadic template constructor.
GlobalSystemMatrix matrix_sys
The global system matrix.
BaseClass::LocalSystemVectorL LocalSystemVectorL
Local left-vectors (dual space)
BaseClass::LocalCoordsBuffer LocalCoordsBuffer
Local coordinates buffer type for passing information to or from the mesh.
LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence
... and a sequence of UnitFilters
Global::Muxer< LocalSystemVectorR, SystemMirror > GlobalSystemMuxer
The global muxer for mapping data from one partitioning to the other on this level.
LocalFunctional::FilterType LocalSystemFilter
Filter for the local system.
LAFEM::Transfer< LocalSystemTransferMatrix > LocalSystemTransfer
Local transfer operator.
LAFEM::VectorMirror< DT_, IT_ > ScalarMirror
Mirrors for scalar vectors.
BaseClass::LocalScalarVector LocalScalarVector
Local vectors of scalar quantities.
Global::Vector< LocalSystemVectorL, SystemMirror > GlobalSystemVectorL
Global left-vectors.
LocalFunctional::MatrixType LocalMatrix
The local system matrix type (for the gradient)
LocalFunctional::TrafoType TrafoType
The underlying transformation.
Global::Transfer< LocalSystemTransfer, SystemMirror > GlobalSystemTransfer
Global system transfer operator.
Global::Vector< LocalCoordsBuffer, SystemMirror > GlobalCoordsBuffer
Global coordinates buffer.
MeshoptSystemLevel< DT_, IT_, Functional_ > BaseClass
Our base class.
LAFEM::SparseMatrixBWrappedCSR< DT_, IT_, LocalFunctional::MeshType::world_dim > LocalSystemTransferMatrix
Local inter-level transfer matrix.
Global::Matrix< LocalMatrix, SystemMirror, SystemMirror > GlobalSystemMatrix
Global mesh quality functional type.
Global::Gate< LocalScalarVector, ScalarMirror > ScalarGate
Gates for scalar vectors.
BaseClass::LocalSystemVectorR LocalSystemVectorR
Local right-vectors (primal space)
BaseClass::SystemGate SystemGate
Gates for the system.
LocalFunctional::SpaceType SpaceType
The finite element space.
Communicator class.
Definition: dist.hpp:1349
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
Definition: dist.cpp:655
VTK exporter class template.
Definition: export_vtk.hpp:119
Root mesh node class template.
Definition: mesh_node.hpp:748
Global Filter wrapper class template.
Definition: filter.hpp:21
Global gate implementation.
Definition: gate.hpp:51
void compile(LocalVector_ &&vector)
Compiles the gate to finish its setup.
Definition: gate.hpp:296
void sync_0(LocalVector_ &vector) const
Synchronizes a type-0 vector, resulting in a type-1 vector.
Definition: gate.hpp:408
void push(int rank, Mirror_ &&mirror)
Adds a mirror for a neighbor process.
Definition: gate.hpp:274
void set_comm(const Dist::Comm *comm_)
Sets the communicator for this gate.
Definition: gate.hpp:149
Global Matrix wrapper class template.
Definition: matrix.hpp:40
Global multiplexer/demultiplexer implementation.
Definition: muxer.hpp:68
Global NonlinearFunctional wrapper class template.
Global grid-transfer operator class template.
Definition: transfer.hpp:23
LocalTransfer_ & local()
Definition: transfer.hpp:131
Global vector wrapper class template.
Definition: vector.hpp:68
void format(DataType alpha=DataType(0))
Reset all elements of the container to a given value or zero if missing.
Definition: vector.hpp:302
LocalVector_ & local()
Returns a reference to the internal local LAFEM vector object.
Definition: vector.hpp:121
void sync_0()
Performs a type-0 synchronization of the vector, i.e. sums up all local DOF contributions.
Definition: vector.hpp:187
bool empty() const
Checks whether the container is empty.
Definition: container.hpp:1165
void format(DT_ value=DT_(0))
Reset all elements of the container to a given value or zero if missing.
Definition: container.hpp:851
Blocked Dense data vector class template.
Wraps a SparseMatrixCSR to SparseMatrixBCSR.
SparseMatrixCSR transpose() const
Calculate .
VectorTypeL create_vector_l() const
Returns a new compatible L-Vector.
void scale_rows(const SparseMatrixCSR &x, const DenseVector< DT_, IT_ > &s)
Calculate .
Grid-Transfer operator class template.
Definition: transfer.hpp:27
Handles vector prolongation, restriction and serialization.
String class implementation.
Definition: string.hpp:46
const Operation op_min(MPI_MIN)
Operation wrapper for MPI_MIN.
Definition: dist.hpp:275
const Operation op_sum(MPI_SUM)
Operation wrapper for MPI_SUM.
Definition: dist.hpp:271
FEAT namespace.
Definition: adjactor.hpp:12
String stringify(const T_ &item)
Converts an item into a String.
Definition: string.hpp:944
std::uint64_t Index
Index data type.
Helper class for computing heuristic mesh quality.
static VtxType_::CoordType compute(const IdxType_ &idx, const VtxType_ &vtx)
Computes minimum cell quality.