57class HyodaMixedCellsUnitTest:
public ArcaneHyodaMixedCellsUnitTestObject{
60 ArcaneHyodaMixedCellsUnitTestObject(sbi),
61 m_sub_domain(subDomain()),
66 m_interface_normal(
VariableBuildInfo(subDomain()->defaultMesh(),
"InterfaceNormal")),
67 m_interface_distance(
VariableBuildInfo(subDomain()->defaultMesh(),
"InterfaceDistance2")){
69 ~HyodaMixedCellsUnitTest(){}
75 info() <<
"\33[7m[HyodaMixedCellsUnitTest::build]\33[m";
84 void onTimeLoopStartInit(){
85 info() <<
"\33[7m[HyodaMixedCellsUnitTest::onTimeLoopStartInit]\33[m";
90 m_qedge[face]=(
Real)face->uniqueId().asInteger();
94 for(
Integer i=0,n=options()->material().size(); i<n; ++i){
95 String mat_name = options()->material[i].name;
96 info() <<
"Registering material" << mat_name;
97 m_material_mng->registerMaterialInfo(mat_name);
101 for(
Integer i=0,n=options()->environment().size(); i<n; ++i){
102 String env_name = options()->environment[i].name;
103 info() <<
"Creating environment name=" << env_name;
105 for(
Integer k=0,kn=options()->environment[i].material.size(); k<kn; ++k ){
106 String mat_name = options()->environment[i].material[k];
107 info() <<
"\tAdding material " << mat_name <<
" for environment " << env_name;
110 m_material_mng->createEnvironment(env_build);
113 m_material_mng->endCreate();
119 for (
Node node : cell->nodes() ){
120 maxX=math::max(maxX, nodesCoordinates()[node].x);
121 maxY=math::max(maxY, nodesCoordinates()[node].y);
128 Real ix=maxX/options()->environment().size();
129 info() <<
"maxX="<<maxX<<
", ix="<<ix;
130 info() <<
"maxY="<<maxY;
140 Real iy=maxY/m_material_mng->environments()[iEnv]->nbMaterial();
144 ids[iEnv][iMat0].add(cell.itemLocalId());
156 for(
Integer i=0,n=options()->environment().size(); i<n; ++i){
158 info() <<
"[EnvInit] "<<env->
name()<<
", nbMaterial="<<env->
nbMaterial();
162 info() <<
"\t[EnvInit] adding cell #"<<ids[i][j];
188 m_density[*cell] = (double)cell.itemLocalId();
189 info()<<
"m_density[*cell]="<<m_density[*cell];
193 m_interface_distance.resize(1);
197 m_interface_distance[cell][0]=((nodesCoordinates()[cell->node(0)]-(nodesCoordinates()[cell->node(0)]+
198 nodesCoordinates()[cell->node(1)]+
199 nodesCoordinates()[cell->node(2)]+
200 nodesCoordinates()[cell->node(3)])/4.0).normL2())/2.0;
210 void onTimeLoopBeginLoop(){
211 const Real3 normal=
Real3(cos(m_theta),sin(m_theta),0.0);
212 info() <<
"\33[7m[HyodaMixedCellsUnitTest::onTimeLoopBeginLoop]\33[m m_theta="<<m_theta;
213 info() <<
"[HyodaMixedCellsUnitTest::onTimeLoopBeginLoop] normal="<<normal;
214 ARCANE_HYODA_SOFTBREAK(subDomain());
215 if (m_global_iteration()>options()->iterations())
216 subDomain()->timeLoopMng()->stopComputeLoop(
true);
218 m_interface_normal[cell]=normal;
222 m_theta+=cgrPI/180.0;
232 void onTimeLoopRestore(){
233 info() <<
"\33[7m[HyodaMixedCellsUnitTest::onTimeLoopRestore]\33[m";
Interface du gestionnaire d'un sous-domaine.