1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
// Copyright (C) 2020-2021 Jorgen S. Dokken
//
// This file is part of DOLFINX_MPC
//
// SPDX-License-Identifier: MIT
#pragma once
#include "MultiPointConstraint.h"
#include <dolfinx/fem/DirichletBC.h>
#include <dolfinx/fem/Form.h>
#include <functional>
namespace dolfinx_mpc
{
template <typename T, std::floating_point U>
class MultiPointConstraint;
/// Assemble bilinear form into a matrix
/// @param[in] mat_add_block The function for adding block values into the
/// matrix
/// @param[in] mat_add The function for adding values into the matrix
/// @param[in] a The bilinear from to assemble
/// @param[in] bcs Boundary conditions to apply. For boundary condition
/// dofs the row and column are zeroed. The diagonal entry is not set.
/// @param[in] diagval Value to set on diagonal of matrix for slave dofs and
/// Dirichlet BC (default=1)
void assemble_matrix(
const std::function<int(std::span<const std::int32_t>,
std::span<const std::int32_t>,
const std::span<const double>&)>& mat_add_block,
const std::function<int(std::span<const std::int32_t>,
std::span<const std::int32_t>,
const std::span<const double>&)>& mat_add,
const dolfinx::fem::Form<double>& a,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<double, double>>& mpc0,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<double, double>>& mpc1,
const std::vector<std::shared_ptr<const dolfinx::fem::DirichletBC<double>>>&
bcs,
const double diagval = 1.0);
//-----------------------------------------------------------------------------
/// Assemble bilinear form into a matrix
/// @param[in] mat_add_block The function for adding block values into the
/// matrix
/// @param[in] mat_add The function for adding values into the matrix
/// @param[in] a The bilinear from to assemble
/// @param[in] bcs Boundary conditions to apply. For boundary condition
/// dofs the row and column are zeroed. The diagonal entry is not set.
/// @param[in] diagval Value to set on diagonal of matrix for slave dofs and
/// Dirichlet BC (default=1)
void assemble_matrix(
const std::function<
int(std::span<const std::int32_t>, std::span<const std::int32_t>,
const std::span<const std::complex<double>>&)>& mat_add_block,
const std::function<
int(std::span<const std::int32_t>, std::span<const std::int32_t>,
const std::span<const std::complex<double>>&)>& mat_add,
const dolfinx::fem::Form<std::complex<double>>& a,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<std::complex<double>, double>>&
mpc0,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<std::complex<double>, double>>&
mpc1,
const std::vector<
std::shared_ptr<const dolfinx::fem::DirichletBC<std::complex<double>>>>&
bcs,
const std::complex<double> diagval = 1.0);
/// Assemble bilinear form into a matrix
/// @param[in] mat_add_block The function for adding block values into the
/// matrix
/// @param[in] mat_add The function for adding values into the matrix
/// @param[in] a The bilinear from to assemble
/// @param[in] bcs Boundary conditions to apply. For boundary condition
/// dofs the row and column are zeroed. The diagonal entry is not set.
/// @param[in] diagval Value to set on diagonal of matrix for slave dofs and
/// Dirichlet BC (default=1)
void assemble_matrix(
const std::function<int(std::span<const std::int32_t>,
std::span<const std::int32_t>,
const std::span<const float>&)>& mat_add_block,
const std::function<int(std::span<const std::int32_t>,
std::span<const std::int32_t>,
const std::span<const float>&)>& mat_add,
const dolfinx::fem::Form<float>& a,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<float, float>>& mpc0,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<float, float>>& mpc1,
const std::vector<std::shared_ptr<const dolfinx::fem::DirichletBC<float>>>&
bcs,
const float diagval = 1.0);
//-----------------------------------------------------------------------------
/// Assemble bilinear form into a matrix
/// @param[in] mat_add_block The function for adding block values into the
/// matrix
/// @param[in] mat_add The function for adding values into the matrix
/// @param[in] a The bilinear from to assemble
/// @param[in] bcs Boundary conditions to apply. For boundary condition
/// dofs the row and column are zeroed. The diagonal entry is not set.
/// @param[in] diagval Value to set on diagonal of matrix for slave dofs and
/// Dirichlet BC (default=1)
void assemble_matrix(
const std::function<
int(std::span<const std::int32_t>, std::span<const std::int32_t>,
const std::span<const std::complex<float>>&)>& mat_add_block,
const std::function<
int(std::span<const std::int32_t>, std::span<const std::int32_t>,
const std::span<const std::complex<float>>&)>& mat_add,
const dolfinx::fem::Form<std::complex<float>>& a,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<std::complex<float>, float>>&
mpc0,
const std::shared_ptr<
const dolfinx_mpc::MultiPointConstraint<std::complex<float>, float>>&
mpc1,
const std::vector<
std::shared_ptr<const dolfinx::fem::DirichletBC<std::complex<float>>>>&
bcs,
const std::complex<float> diagval = 1.0);
} // namespace dolfinx_mpc
|