Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Momentmodels, bindable numerical fluxes, etc #170

Merged
merged 101 commits into from Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
0ff8652
start adding momentmodels
tobiasleibner Mar 23, 2019
b1cdf75
[test] start fixing mn models
tobiasleibner Mar 24, 2019
f2e0144
[test] fix compilation of mn tests
tobiasleibner Mar 26, 2019
77f9438
[test] adapt expectations
tobiasleibner Mar 27, 2019
46f49ea
[momentmodels] start cleaning up
tobiasleibner Mar 27, 2019
00843de
[entropy] use dynamic jacobian types
tobiasleibner Mar 28, 2019
1b937f0
[momentmodels] improve performance
tobiasleibner Apr 2, 2019
f2045d0
[momentmodels.entropyflux_implementations] use unsafe_add_to_entry
tobiasleibner Apr 2, 2019
7b5889c
[momentmodels] fix tests, start cleaning up
tobiasleibner Apr 3, 2019
e1d5961
[tests.momentmodels.pn] test both reconstruction operators
tobiasleibner Apr 4, 2019
78140fc
[numerical-fluxes] fix merge conflicts
tobiasleibner Apr 5, 2019
856b5aa
[momentmodels] fix tests
tobiasleibner Apr 8, 2019
3989977
[test.pn] fix headercheck
tobiasleibner Apr 9, 2019
bcd6b1a
[examples] fix compilation of mpi_2019_02_talk_on_hyperbolic_equations
tobiasleibner Apr 9, 2019
c5ea5c6
[operators.advection] fix segfault in jacobian
tobiasleibner Apr 9, 2019
21b56df
[tools] fix warnings
tobiasleibner Apr 9, 2019
f74fb98
[test.momentmodels.checkerboard] fix domain definition
tobiasleibner Apr 9, 2019
b859d37
[operators.reconstruction] fix compilation without Qhull
tobiasleibner Apr 10, 2019
c1674c8
[local.operators] fix automatic jacobians
tobiasleibner Apr 10, 2019
029d11d
[operators.reconstruction] another compile fix
tobiasleibner Apr 10, 2019
854fa58
[operators.advection-fv] fix if MPI and reconstruction is used
tobiasleibner Apr 11, 2019
bb76e0d
[test] fix passing gridsize as array
tobiasleibner Apr 12, 2019
5d89563
[operators] add GenericOperator
tobiasleibner Apr 23, 2019
78a5a15
[momentmodels] use dimFlux, rename alpha_iso_prime -> alpha_one
tobiasleibner Apr 23, 2019
7916d30
[tools.timestepper] fix visualization
tobiasleibner Apr 23, 2019
e1b21ea
disambiguate some constructions
tobiasleibner May 2, 2019
629f04c
Merge branch 'master' of github.com:dune-community/dune-gdt into dail…
tobiasleibner May 16, 2019
23879be
[operators.reconstruction] remove unused include
tobiasleibner Jun 13, 2019
39994cc
Start adding kinetic scheme
tobiasleibner Jun 13, 2019
cff80ff
fix headercheck
tobiasleibner Jun 13, 2019
40dbafb
[test] Add tests for kinetic scheme
tobiasleibner Jun 13, 2019
4a3d668
[test] Fix tests for kinetic scheme
tobiasleibner Jun 26, 2019
cd9d649
[.ci/shared] bump
tobiasleibner Jun 27, 2019
b99a3c6
[momentmodels] start adding different entropy
tobiasleibner Jul 2, 2019
252c326
[hyperbolic] make Bose-Einstein entropy work for Mn
tobiasleibner Jul 3, 2019
2e181bd
[hyperbolic] fix partial moment specialization
tobiasleibner Jul 3, 2019
2ae3295
[momentmodels] enable some more tests
tobiasleibner Jul 4, 2019
859e116
[momentmodels] fix 1d hatfunction specialization
tobiasleibner Jul 4, 2019
5f8d149
[momentmodels] finish implementing other entropies
tobiasleibner Jul 4, 2019
44e8030
[momentmodels] some small improvements
tobiasleibner Jul 5, 2019
cdf3e1f
[hyperbolic] fix compilation of some test
tobiasleibner Jul 8, 2019
1ccf3eb
[hyperbolic] Fix some errors when dependencies are missing
tobiasleibner Jul 8, 2019
2e5aa16
[hyperbolic] increase tolerance in one test
tobiasleibner Jul 8, 2019
06ed1a9
[entropyflux] ensure positivity if BoseEinstein entropy is used
tobiasleibner Jul 9, 2019
54d4159
[entropyflux] silence warnings
tobiasleibner Jul 9, 2019
5aaa654
[momentmodels] improve partial moment basis for large n
tobiasleibner Jul 10, 2019
4d1e7da
[momentmodels] Some fixes for high-order moments
tobiasleibner Jul 15, 2019
f44bb71
[tools.adaption-helper] fix compilation for old gcc
tobiasleibner Jul 15, 2019
ac8db53
move momentmodels folder to test
tobiasleibner Jul 15, 2019
a558063
[momentmodels] fix some minor errors
tobiasleibner Jul 17, 2019
dc24673
[momentmodels] remove file
tobiasleibner Jul 17, 2019
ee41be3
[momentmodels] some fixes, new tests
tobiasleibner Jul 18, 2019
94d2574
[local] fix construction of ProductIntegrand
tobiasleibner Jul 23, 2019
ac1c153
[ci|gitlab] allow shared runners to pickup builds
renefritze Jul 23, 2019
fdb6a0c
Revert "[ci|gitlab] allow shared runners to pickup builds"
renefritze Jul 24, 2019
c83a9dc
[ci] bump
renefritze Jul 24, 2019
5290f1b
[test] cleanup
tobiasleibner Jul 23, 2019
a4d74b9
[test] add tests for some integrands
tobiasleibner Jul 24, 2019
8d517a1
[test] fix compilation of pn test
tobiasleibner Jul 24, 2019
f517c4d
[integrands] add gradient_value integrand
tobiasleibner Jul 24, 2019
9212c18
[mapper.continuous] allow for polynomial order 3 or higher
tobiasleibner Jul 25, 2019
08efa6e
[spaces] make spaces copyable for thread safety
tobiasleibner Jul 25, 2019
2f1f12c
[entropyflux] fix compilation
tobiasleibner Jul 26, 2019
f90a662
[test] fix threaded burgers 1d test
tobiasleibner Jul 26, 2019
74f3962
[local] More fixes for threaded tests
tobiasleibner Jul 26, 2019
89db6a7
[test] cleanup stokes test
tobiasleibner Jul 30, 2019
074c3bd
[test] add test for default_interpolation
tobiasleibner Aug 5, 2019
5785aab
[finite-elements.wrapper] improve performance
tobiasleibner Aug 6, 2019
523f8be
[test] fix warnings
tobiasleibner Aug 13, 2019
839964d
[local.finite-elements.0d] fix another warning
tobiasleibner Aug 19, 2019
e5b7716
bump ci
tobiasleibner Aug 19, 2019
4b12751
[integrands] fix quadrature order
tobiasleibner Aug 21, 2019
4778068
[discretefunction] allow to enable/disable subsampling
tobiasleibner Aug 23, 2019
7345660
Merge branch 'parabolic-lrbms-2018-updates' of github.com:dune-commun…
tobiasleibner Aug 23, 2019
9f2415e
fix headercheck after merge
tobiasleibner Aug 23, 2019
d84f901
Fix some more merge problems
tobiasleibner Aug 23, 2019
d9d3995
[test] fix elliptic, rename to laplace
tobiasleibner Aug 23, 2019
83344d0
[test.diffusion-ipdg] fix
tobiasleibner Aug 23, 2019
e5e09dc
[test.ESV2007] adapt expectations to corrected quadrature order
tobiasleibner Aug 25, 2019
f36da3d
[entropyflux] adapt to CBLAS changes in xt-common
tobiasleibner Aug 27, 2019
28e5bc5
update ci
tobiasleibner Aug 27, 2019
d396207
[momentmodels] fix 2d checkerboard
tobiasleibner Aug 29, 2019
e8b33d8
clang format
tobiasleibner Aug 30, 2019
d8f6cbc
[test.momentmodels] fix segfault
tobiasleibner Aug 30, 2019
f848c08
[examples.adaptive_elliptic_swipdg] fix compilation
tobiasleibner Sep 3, 2019
0b23bb1
[integrands.generic] add post_bind function
tobiasleibner Sep 4, 2019
f9f4d35
Merge branch 'master' of github.com:dune-community/dune-gdt into mome…
tobiasleibner Sep 16, 2019
62d313f
[operators] fix merge errors
tobiasleibner Sep 23, 2019
22c9ede
[operators.advection] fix copying
tobiasleibner Sep 23, 2019
3dd8325
bump ci
tobiasleibner Sep 24, 2019
cac9766
[functionals.vector-based] do not turn clang-format off
tobiasleibner Sep 24, 2019
a3b6af9
[discretefunction] datahandle.hh -> default-datahandle.hh
tobiasleibner Sep 26, 2019
73b8620
[spaces] make copy pure virtual
tobiasleibner Sep 26, 2019
d5a1979
remove all virtual from 'virtual ... override'
tobiasleibner Sep 26, 2019
f314716
Address review comments
tobiasleibner Sep 27, 2019
3362f65
[local.operators] change apply signature of LocalIntersectionOperator…
tobiasleibner Sep 30, 2019
bfe4cd8
remove template arguments from ThisType to save refactoring work
tobiasleibner Sep 30, 2019
94a31b2
[local.operator] adapt to new apply signature
tobiasleibner Sep 30, 2019
bfebdaf
[local] add some missing binds
tobiasleibner Sep 30, 2019
d122d33
[local.operators] do not use intersection.outside() if intersection.n…
tobiasleibner Sep 30, 2019
e933aa3
[operators.advection-fv-entropybased] fix
tobiasleibner Sep 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -46,3 +46,5 @@ demos-*
build-*
*.pyc
.idea
tags
.vscode
111 changes: 111 additions & 0 deletions dune/gdt/discretefunction/datahandle.hh
@@ -0,0 +1,111 @@
// This file is part of the dune-gdt project:
// https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Rene Milk (2018)
// Tobias Leibner (2017)

#ifndef DUNE_GDT_DISCRETEFUNCTION_DATAHANDLE_HH
tobiasleibner marked this conversation as resolved.
Show resolved Hide resolved
#define DUNE_GDT_DISCRETEFUNCTION_DATAHANDLE_HH

#include <dune/grid/common/datahandleif.hh>

#include <dune/xt/common/unused.hh>

namespace Dune {
namespace GDT {


template <class DiscreteFunctionType>
class DiscreteFunctionDataHandle
: public Dune::CommDataHandleIF<DiscreteFunctionDataHandle<DiscreteFunctionType>,
typename DiscreteFunctionType::SpaceType::R>
{
public:
DiscreteFunctionDataHandle(DiscreteFunctionType& discrete_function, bool fixed_size = true)
: discrete_function_(discrete_function)
, mapper_(discrete_function_.space().mapper())
, vector_(discrete_function_.dofs().vector())
, fixed_size_(fixed_size)
{}

//! export type of data for message buffer
typedef typename DiscreteFunctionType::SpaceType::D DataType;

//! returns true if data for this codim should be communicated
bool contains(int /*dim*/, int codim) const
{
return (codim == 0);
}

//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int /*dim*/, int /*codim*/) const
{
return fixed_size_;
}

/*! how many objects of type DataType have to be sent for a given entity

Note: Only the sender side needs to know this size.
*/
template <class EntityType>
std::enable_if_t<EntityType::codimension != 0, size_t> size(const EntityType& /*entity*/) const
{
return 0;
}

/*! how many objects of type DataType have to be sent for a given entity
Note: Only the sender side needs to know this size.
*/
template <class EntityType>
std::enable_if_t<EntityType::codimension == 0, size_t> size(const EntityType& entity) const
{
return discrete_function_.space().mapper().local_size(entity);
}

//! pack data from user to message buffer
template <class MessageBuffer, class EntityType>
std::enable_if_t<EntityType::codimension != 0> gather(MessageBuffer& /*buff*/, const EntityType& /*entity*/) const
{}

template <class MessageBuffer, class EntityType>
std::enable_if_t<EntityType::codimension == 0> gather(MessageBuffer& buff, const EntityType& entity) const
{
const auto global_indices = mapper_.global_indices(entity);
for (const auto& index : global_indices)
buff.write(vector_.get_entry(index));
}

/*! unpack data from message buffer to user
n is the number of objects sent by the sender
*/
template <class MessageBuffer, class EntityType>
std::enable_if_t<EntityType::codimension != 0>
scatter(MessageBuffer& /*buff*/, const EntityType& /*entity*/, size_t /*n*/)
{}

template <class MessageBuffer, class EntityType>
std::enable_if_t<EntityType::codimension == 0>
scatter(MessageBuffer& buff, const EntityType& entity, size_t DXTC_DEBUG_ONLY(n))
{
assert(mapper_.local_size(entity) == n);
const auto global_indices = mapper_.global_indices(entity);
for (const auto& index : global_indices)
buff.read(vector_[index]);
}

private:
DiscreteFunctionType& discrete_function_;
const typename DiscreteFunctionType::SpaceType::MapperType& mapper_;
typename DiscreteFunctionType::VectorType& vector_;
const bool fixed_size_;
};


} // namespace GDT
} // namespace Dune

#endif // DUNE_GDT_DISCRETEFUNCTION_DATAHANDLE_HH
30 changes: 27 additions & 3 deletions dune/gdt/discretefunction/default.hh
Expand Up @@ -124,6 +124,7 @@ public:
*/

using BaseType::visualize;
using BaseType::visualize_gradient;

/**
* \brief Visualizes the function using Dune::XT::Functions::GridFunctionInterface::visualize on the grid view
Expand All @@ -135,9 +136,27 @@ public:
const VTK::OutputType vtk_output_type = VTK::appendedraw,
const XT::Common::Parameter& param = {}) const
{
this->visualize(space_.grid_view(), filename, space_.max_polorder() > 1, vtk_output_type, param);
const bool subsampling =
param.has_key("subsampling") ? static_cast<bool>(param.get("subsampling")[0]) : (space_.max_polorder() > 1);
this->visualize(space_.grid_view(), filename, subsampling, vtk_output_type, param);
}

/**
* \brief Visualizes the function using Dune::XT::Functions::GridFunctionInterface::visualize on the grid view
* associated with the space.
* \sa Dune::XT::Functions::GridFunctionInterface::visualize
* \note Subsampling is enabled by default for functions of order greater than one.
*/
void visualize_gradient(const std::string filename,
const VTK::OutputType vtk_output_type = VTK::appendedraw,
const XT::Common::Parameter& param = {}) const
{
const bool subsampling =
param.has_key("subsampling") ? static_cast<bool>(param.get("subsampling")[0]) : (space_.max_polorder() > 1);
this->visualize_gradient(space_.grid_view(), filename, subsampling, vtk_output_type, param);
}


protected:
const SpaceType& space_;

Expand Down Expand Up @@ -188,12 +207,17 @@ public:
{}

DiscreteFunction(const SpaceType& spc, const std::string nm = "dune.gdt.discretefunction")
: VectorStorage(new VectorType(spc.mapper().size(), 0))
: VectorStorage(new VectorType(spc.mapper().size(), 0.))
, BaseType(spc, VectorStorage::access(), nm)
, dofs_(space_.mapper(), VectorStorage::access())
{}

DiscreteFunction(const ThisType&) = default;
DiscreteFunction(const ThisType& other)
: VectorStorage(new VectorType(other.access()))
, BaseType(other.space(), VectorStorage::access(), other.name())
, dofs_(other.space().mapper(), VectorStorage::access())
{}

DiscreteFunction(ThisType&&) = default;

ThisType& operator=(const ThisType&) = delete;
Expand Down
4 changes: 0 additions & 4 deletions dune/gdt/functionals/vector-based.hh
Expand Up @@ -25,8 +25,6 @@

#include "interfaces.hh"

// clang-format off
// see https://github.com/dune-community/dune-gdt/issues/142
namespace Dune {
namespace GDT {

Expand Down Expand Up @@ -277,6 +275,4 @@ make_vector_functional(const SpaceInterface<GV, r, rC, F>& space)
} // namespace GDT
} // namespace Dune

// clang-format on

#endif // DUNE_GDT_FUNCTIONALS_VECTOR_BASED_HH