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::block_height> 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.num_nzes() > 0)
548 {
549 // Temporary DenseVector for syncing
550 LocalSystemVectorL tmp(slip_filter_vector.size());
551 auto tmp_elements = tmp.elements_view_rw();
552 const auto sfv_indices = slip_filter_vector.indices_view_r();
553 auto sfv_elements = slip_filter_vector.elements_view_rw();
554
555 // Copy sparse filter vector contents to DenseVector
556 for(Index isparse(0); isparse < slip_filter_vector.num_nzes(); ++isparse)
557 {
558 tmp_elements[sfv_indices(isparse)] = 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.num_nzes(); ++isparse)
565 {
566 sfv_elements[isparse] = tmp_elements[sfv_indices(isparse)];
567 }
568 }
569 else
570 {
571 // Temporary DenseVector for syncing
572 LocalSystemVectorL tmp(slip_filter_vector.size());
573 gate_sys.sync_0(tmp);
574 }
575 }
576
577 } // evil slip filter sync
578
579 }
580
589 {
590 XASSERTM(!empty(), "Assemble_rhs_vector for empty functional");
591
592 // create new vector
594
595 vec_rhs.format();
596 filter_sys.filter_rhs(vec_rhs);
597
598 return vec_rhs;
599 }
600
607 {
608 XASSERTM(!empty(), "Assemble_sol_vector for empty functional");
610
611 vec_sol.local().copy(coords_buffer.local());
612 filter_sys.local().template at<1>().filter_sol(vec_sol.local());
613
614 return vec_sol;
615 }
616
627 template<typename DomainLayer_>
628 void assemble_gates(const DomainLayer_& dom_layer)
629 {
630 // set the gate comm
631 gate_sys.set_comm(dom_layer.comm_ptr());
632 gate_scalar.set_comm(dom_layer.comm_ptr());
633
634 // Loop over all ranks
635 for(Index i(0); i < dom_layer.neighbor_count(); ++i)
636 {
637 int rank(dom_layer.neighbor_rank(i));
638
639 // try to find our halo
640 auto* halo = local_functional.get_mesh_node()->get_halo(rank);
641 XASSERTM(halo != nullptr, "Halo not found.");
642
643 // assemble the system mirror
644 SystemMirror sys_mirror;
645 Assembly::MirrorAssembler::assemble_mirror(sys_mirror, local_functional.trafo_space, *halo);
646
647 // push mirror into gates
648 gate_sys.push(rank, std::move(sys_mirror));
649
650 // assemble the scalar mirror
651 ScalarMirror scalar_mirror;
652 Assembly::MirrorAssembler::assemble_mirror(scalar_mirror, local_functional.trafo_space, *halo);
653
654 // push mirror into gates
655 gate_scalar.push(rank, std::move(scalar_mirror));
656 }
657
658 // create local template vectors
659 LocalSystemVectorR tmp_sys(local_functional.trafo_space.get_num_dofs());
660 LocalScalarVector tmp_scalar(local_functional.trafo_space.get_num_dofs());
661
662 // compile gates
663 gate_sys.compile(std::move(tmp_sys));
664 gate_scalar.compile(std::move(tmp_scalar));
665 }
666
675 {
676 // get global transfer operator
677 GlobalSystemTransfer& glob_trans = this->transfer_sys;
678
679 // get local transfer operator
680 LocalSystemTransfer& loc_trans = glob_trans.local();
681
682 // get local transfer matrices
683 typename LocalSystemTransferMatrix::BaseClass& loc_prol = loc_trans.get_mat_prol();
684 typename LocalSystemTransferMatrix::BaseClass& loc_rest = loc_trans.get_mat_rest();
685
686 // assemble structure?
687 if (loc_prol.empty())
688 {
690 loc_prol, local_functional.trafo_space, level_coarse.local_functional.trafo_space);
691 }
692
693 // Create a global scalar weight vector
694 GlobalScalarVector glob_vec_weight( &this->gate_scalar, loc_prol.create_vector_l());
695 // Get local scalar weight vector
696 auto& loc_vec_weight = glob_vec_weight.local();
697
698 // Assemble the underlying scalar prolongation matrix
699 {
700 Cubature::DynamicFactory cubature_factory("auto-degree:3");
701
702 loc_prol.format();
703 loc_vec_weight.format();
704
705 // Assemble prolongation matrix
706 Assembly::GridTransfer::assemble_prolongation(loc_prol, loc_vec_weight,
707 local_functional.trafo_space, level_coarse.local_functional.trafo_space, cubature_factory);
708
709 // Synchronize weight vector
710 glob_vec_weight.sync_0();
711
712 // Invert components
713 loc_vec_weight.component_invert(loc_vec_weight);
714
715 // Scale prolongation matrix
716 loc_prol.scale_rows(loc_prol, loc_vec_weight);
717
718 // Copy and transpose
719 loc_rest = loc_prol.transpose();
720 }
721 }
722
723 }; // class MeshoptSystemLevel
724
741 template
742 <
743 typename DT_, typename IT_,
744 template<typename, typename> class Functional_
745 >
746 class QuadraticSystemLevel : public MeshoptSystemLevel<DT_, IT_, Functional_>
747 {
748 public:
750 typedef DT_ DataType;
752 typedef IT_ IndexType;
753
756
758 typedef Functional_<DT_, IT_> LocalFunctional;
759
761 typedef typename LocalFunctional::SpaceType SpaceType;
763 typedef typename LocalFunctional::TrafoType TrafoType;
765 typedef typename TrafoType::MeshType MeshType;
766
768 typedef typename LocalFunctional::MatrixType LocalMatrix;
782
784 typedef typename LocalFunctional::FilterType LocalSystemFilter;
786 typedef typename LocalFunctional::SlipFilterSequence LocalSlipFilterSequence;
788 typedef typename LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence;
789
798
815
816 public:
819
820 public:
846 template<typename... Args_>
847 explicit QuadraticSystemLevel(const int level_index,
849 TrafoType& trafo,
850 const std::deque<String>& dirichlet_list,
851 const std::deque<String>& slip_list,
852 Args_&&... args) :
853 BaseClass(level_index, rmn, trafo, dirichlet_list, slip_list, std::forward<Args_>(args)...),
855 BaseClass::local_functional.matrix_sys.clone(LAFEM::CloneMode::Shallow))
856 {
857 }
858
863 {
864 }
865
866 }; // class QuadraticSystemLevel<...>
867
883 template
884 <
885 typename DT_, typename IT_,
886 template<typename, typename> class Functional_
887 >
888 class NonlinearSystemLevel : public MeshoptSystemLevel<DT_, IT_, Functional_>
889 {
890 public:
892 typedef DT_ DataType;
894 typedef IT_ IndexType;
895
897 typedef Functional_<DT_, IT_> LocalFunctional;
898
901
903 typedef typename LocalFunctional::SpaceType SpaceType;
905 typedef typename LocalFunctional::TrafoType TrafoType;
907 typedef typename TrafoType::MeshType MeshType;
908
910 typedef typename LocalFunctional::VectorTypeL LocalSystemVectorL;
912 typedef typename LocalFunctional::VectorTypeR LocalSystemVectorR;
914 typedef typename LocalFunctional::ScalarVectorType LocalScalarVector;
916 typedef typename LocalFunctional::CoordsBufferType LocalCoordsBuffer;
922
924 typedef typename LocalFunctional::FilterType LocalSystemFilter;
926 typedef typename LocalFunctional::SlipFilterSequence LocalSlipFilterSequence;
928 typedef typename LocalFunctional::DirichletFilterSequence LocalDirichletFilterSequence;
929
938
955
956 public:
959
960 public:
986 template<typename... Args_>
987 explicit NonlinearSystemLevel(const int level_index,
989 TrafoType& trafo,
990 const std::deque<String>& dirichlet_list,
991 const std::deque<String>& slip_list,
992 Args_&&... args) :
993 BaseClass(level_index, rmn, trafo, dirichlet_list, slip_list, std::forward<Args_>(args)...),
995 {
996 }
997
1002 {
1003 }
1004
1005 }; // class NonlinearSystemLevel<...>
1006
1007 } // namespace Meshopt
1008
1009 } // namespace Control
1010} //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:1657
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
Definition: dist.cpp:658
VTK exporter class template.
Definition: export_vtk.hpp:196
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:78
void compile(LocalVector_ &&vector)
Compiles the gate to finish its setup.
Definition: gate.hpp:370
void sync_0(LocalVector_ &vector) const
Synchronizes a type-0 vector, resulting in a type-1 vector.
Definition: gate.hpp:552
void push(int rank, Mirror_ &&mirror)
Adds a mirror for a neighbor process.
Definition: gate.hpp:348
void set_comm(const Dist::Comm *comm_)
Sets the communicator for this gate.
Definition: gate.hpp:196
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:318
LocalVector_ & local()
Returns a reference to the internal local LAFEM vector object.
Definition: vector.hpp:122
void sync_0()
Performs a type-0 synchronization of the vector, i.e. sums up all local DOF contributions.
Definition: vector.hpp:188
void format()
Reset all elements of the container to a given value or zero if missing.
Definition: container.hpp:831
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.
bool empty() const
Checks whether the matrix is empty, i.e. whether it is a 0x0 matrix.
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:47
const Operation op_min(MPI_MIN)
Operation wrapper for MPI_MIN.
Definition: dist.hpp:575
const Operation op_sum(MPI_SUM)
Operation wrapper for MPI_SUM.
Definition: dist.hpp:571
FEAT namespace.
Definition: adjactor.hpp:12
String stringify(const T_ &item)
Converts an item into a String.
Definition: string.hpp:993
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.