Ejemplo n.º 1
0
SymmetricContainer<double> FEM::computeLocalRobinMatrix(BoundaryConditions const & BCs,
                                                        array<Node, 2>& nodes,
                                                        double length) {
	SymmetricContainer<double> r(2);
	r(0, 0) = length * ( 3. * BCs.RobinCoefficient(nodes[0]) +      BCs.RobinCoefficient(nodes[1]) ) / 12.;
	r(0, 1) = length * (      BCs.RobinCoefficient(nodes[0]) +      BCs.RobinCoefficient(nodes[1]) ) / 12.;
	r(1, 1) = length * (      BCs.RobinCoefficient(nodes[0]) + 3. * BCs.RobinCoefficient(nodes[1]) ) / 12.;
	return r;
}
Ejemplo n.º 2
0
array<double, 2> FEM::computeLocalRobinVector(BoundaryConditions const & BCs,
                                              array<Node, 2>& nodes,
                                              double length) {
	array<double, 2> r;
	return (r = {
		4. * BCs.NeumannValue(nodes[0]) + 2. * BCs.NeumannValue(nodes[1]) +
		BCs.DirichletCondition(nodes[0]) * ( 3. * BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ) +
		BCs.DirichletCondition(nodes[1]) * ( BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ),
		2. * BCs.NeumannValue(nodes[0]) + 4. * BCs.NeumannValue(nodes[1]) +
		BCs.DirichletCondition(nodes[0]) * ( BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ) +
		BCs.DirichletCondition(nodes[1]) * ( BCs.RobinCoefficient(nodes[0]) + 3. * BCs.RobinCoefficient(nodes[1]) )
	}) *= length / 12.;
}