Commit c15f1ae5 authored by webmanue's avatar webmanue
Browse files

Merge branch '90-add-assemblemassmatrixplugin' into 'master'

Resolve "Add AssembleMassMatrixPlugin"

Closes #90

See merge request mechanics-and-materials/ae108!79
parents 07018cfd 9a9d8af2
Pipeline #142652 passed with stages
in 7 minutes and 15 seconds
// © 2020 ETH Zurich, Mechanics and Materials Lab
// © 2020 California Institute of Technology
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "ae108/assembly/plugins/AssembleMassMatrixPlugin.h"
......@@ -21,6 +21,7 @@ add_library(${PROJECT_NAME}-assembly
./AssembleForceVectorPlugin.cc
./AssembleLumpedMassMatrixPlugin.cc
./AssembleConsistentMassMatrixPlugin.cc
./AssembleMassMatrixPlugin.cc
./AssembleStiffnessMatrixPlugin.cc
./Assembler.cc
./AssemblerGroup.cc
......
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "ae108/assembly/FeaturePlugin.h"
#include "ae108/assembly/utilities/serialize.h"
#include <vector>
namespace ae108 {
namespace assembly {
namespace plugins {
DEFINE_CONST_ASSEMBLER_PLUGIN(AssembleMassMatrixPlugin, assembleMassMatrix,
(matrix_type *const output)) {
std::vector<value_type> outputBuffer;
for (const auto &meshElement : this->assembler().meshElements()) {
const auto matrix = compute_mass_matrix(meshElement.instance());
outputBuffer.resize(matrix.rows() * matrix.cols());
utilities::serialize(matrix, outputBuffer.begin());
meshElement.meshView().addElementMatrix(outputBuffer, output);
}
}
} // namespace plugins
} // namespace assembly
} // namespace ae108
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment