13 #include "libmesh/vector_value.h" 14 #include "metaphysicl/parallel_dualnumber.h" 15 #include "metaphysicl/parallel_numberarray.h" 16 #include "metaphysicl/parallel_semidynamicsparsenumberarray.h" 37 t1 = ex - (ex * n) * n;
48 std::map<
dof_id_type, std::vector<ADReal>> & this_map)
50 std::vector<std::map<dof_id_type, std::vector<ADReal>>> all_maps;
51 comm.allgather(this_map, all_maps);
52 for (
auto & one_map : all_maps)
53 for (
auto & it : one_map)
54 this_map[it.first] = it.second;
59 std::map<
dof_id_type, std::vector<ADReal>> & this_map)
61 std::vector<std::map<dof_id_type, std::vector<ADReal>>> all_maps;
62 comm.allgather(this_map, all_maps);
64 for (
auto & one_map : all_maps)
65 for (
auto & it : one_map)
66 if (this_map.find(it.first) == this_map.end())
67 this_map[it.first] = it.second;
70 auto & existing = this_map[it.first];
72 existing[i] += it.second[i];
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void allGatherADVectorMap(const Parallel::Communicator &comm, std::map< dof_id_type, std::vector< ADReal >> &this_map)
Parallel gather of a map of DoF ID to AD vector.
TypeVector< Real > unit() const
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross(const TypeVector< T2 > &v) const
void computeOrthogonalDirections(const RealVectorValue &n_unnormalized, RealVectorValue &t1, RealVectorValue &t2)
Computes two unit vectors orthogonal to the given vector.
void allGatherADVectorMapSum(const Parallel::Communicator &comm, std::map< dof_id_type, std::vector< ADReal >> &this_map)
Parallel gather of a map of DoF ID to AD vector.
for(PetscInt i=0;i< nvars;++i)
auto index_range(const T &sizable)